|
1 | 1 | name: Main workflow |
2 | | -on: [push] |
| 2 | + |
| 3 | +on: |
| 4 | + pull_request: |
| 5 | + push: |
| 6 | + branches: |
| 7 | + - master |
| 8 | + - releases/* |
| 9 | + |
3 | 10 | jobs: |
4 | | - run: |
5 | | - name: Run |
| 11 | + build: |
6 | 12 | runs-on: ${{ matrix.operating-system }} |
7 | 13 | strategy: |
8 | 14 | matrix: |
9 | 15 | operating-system: [ubuntu-latest, windows-latest] |
10 | 16 | steps: |
11 | | - - uses: actions/checkout@master |
12 | | - |
13 | | - - name: Set Node.js 10.x |
14 | | - uses: actions/setup-node@master |
15 | | - with: |
16 | | - version: 10.x |
| 17 | + - uses: actions/checkout@v2 |
| 18 | + - name: Setup node 12 |
| 19 | + uses: actions/setup-node@v1 |
| 20 | + with: |
| 21 | + node-version: 12.x |
| 22 | + - run: npm ci |
| 23 | + - run: npm run build |
| 24 | + - run: npm run format-check |
| 25 | + - run: npm run pack |
| 26 | + - run: npm test |
| 27 | + - name: Verify no unstaged changes |
| 28 | + if: runner.os != 'windows' |
| 29 | + run: __tests__/verify-no-unstaged-changes.sh |
17 | 30 |
|
18 | | - - name: npm install |
19 | | - run: npm install |
| 31 | + test: |
| 32 | + runs-on: ubuntu-latest |
| 33 | + steps: |
| 34 | + - uses: actions/checkout@v2 |
| 35 | + - name: Clear tool cache |
| 36 | + run: rm -rf $RUNNER_TOOL_CACHE/* |
| 37 | + - name: Setup node 10 |
| 38 | + uses: ./ |
| 39 | + with: |
| 40 | + node-version: 10.x |
| 41 | + - name: Verify node and npm |
| 42 | + run: __tests__/verify-node.sh 10 |
20 | 43 |
|
21 | | - - name: Lint |
22 | | - run: npm run format-check |
| 44 | + test-proxy: |
| 45 | + runs-on: ubuntu-latest |
| 46 | + container: |
| 47 | + image: ubuntu:latest |
| 48 | + options: --dns 127.0.0.1 |
| 49 | + services: |
| 50 | + squid-proxy: |
| 51 | + image: datadog/squid:latest |
| 52 | + ports: |
| 53 | + - 3128:3128 |
| 54 | + env: |
| 55 | + https_proxy: http://squid-proxy:3128 |
| 56 | + steps: |
| 57 | + - uses: actions/checkout@v2 |
| 58 | + - name: Clear tool cache |
| 59 | + run: rm -rf $RUNNER_TOOL_CACHE/* |
| 60 | + - name: Setup node 10 |
| 61 | + uses: ./ |
| 62 | + with: |
| 63 | + node-version: 10.x |
| 64 | + - name: Verify node and npm |
| 65 | + run: __tests__/verify-node.sh 10 |
23 | 66 |
|
24 | | - - name: npm test |
25 | | - run: npm test |
| 67 | + test-bypass-proxy: |
| 68 | + runs-on: ubuntu-latest |
| 69 | + env: |
| 70 | + https_proxy: http://no-such-proxy:3128 |
| 71 | + no_proxy: github.com,nodejs.org,registry.npmjs.org |
| 72 | + steps: |
| 73 | + - uses: actions/checkout@v2 |
| 74 | + - name: Clear tool cache |
| 75 | + run: rm -rf $RUNNER_TOOL_CACHE/* |
| 76 | + - name: Setup node 10 |
| 77 | + uses: ./ |
| 78 | + with: |
| 79 | + node-version: 10.x |
| 80 | + - name: Verify node and npm |
| 81 | + run: __tests__/verify-node.sh 10 |
0 commit comments