|
1 | 1 | name: Main workflow
|
2 | 2 | on: [push, pull_request]
|
3 | 3 | jobs:
|
4 |
| - run: |
5 |
| - name: Run |
| 4 | + build: |
6 | 5 | runs-on: ${{ matrix.operating-system }}
|
7 | 6 | strategy:
|
8 | 7 | matrix:
|
9 | 8 | operating-system: [ubuntu-latest, windows-latest]
|
10 | 9 | steps:
|
11 | 10 | - name: Checkout
|
12 | 11 | uses: actions/checkout@v2
|
13 |
| - |
14 |
| - - name: Setup Node.js 12.x |
| 12 | + - name: Setup Node.js 12 |
15 | 13 | uses: actions/setup-node@v1
|
16 | 14 | with:
|
17 | 15 | node-version: 12.x
|
18 |
| - |
19 | 16 | - name: npm install
|
20 | 17 | run: npm install
|
21 |
| - |
22 | 18 | - name: Lint
|
23 | 19 | run: npm run format-check
|
24 |
| - |
25 | 20 | - name: npm test
|
26 | 21 | run: npm test
|
27 |
| - run-with-proxy: |
28 |
| - name: Run with proxy |
29 |
| - runs-on: ubuntu-latest |
30 |
| - services: |
31 |
| - squid: |
32 |
| - image: dakale/squid |
33 |
| - ports: ['3128:3128'] |
34 |
| - options: '--health-cmd "exit 0" --health-interval 3s' |
35 |
| - env: |
36 |
| - http_proxy: http://localhost:3128 |
37 |
| - https_proxy: http://localhost:3128 |
| 22 | + |
| 23 | + test: |
| 24 | + runs-on: ${{ matrix.operating-system }} |
| 25 | + strategy: |
| 26 | + matrix: |
| 27 | + operating-system: [ubuntu-latest, windows-latest] |
38 | 28 | steps:
|
39 |
| - - name: Block non proxied traffic |
40 |
| - run: | |
41 |
| - echo "127.0.0.0 registry.npm.js nodejs.org github.com api.github.com download.java.net static.azul.com" | sudo tee -a /etc/hosts |
42 | 29 | - name: Checkout
|
43 | 30 | uses: actions/checkout@v2
|
44 |
| - |
45 |
| - - name: Setup Node.js 12.x |
46 |
| - uses: actions/setup-node@v1 |
| 31 | + - name: Clear tool cache |
| 32 | + if: runner.os != 'windows' |
| 33 | + run: mv "${{ runner.tool_cache }}" "${{ runner.tool_cache }}.old" |
| 34 | + - name: Clear tool cache (Windows) |
| 35 | + if: runner.os == 'windows' |
| 36 | + run: move "${{ runner.tool_cache }}" "${{ runner.tool_cache }}.old" |
| 37 | + - name: Setup Java 13 |
| 38 | + uses: ./ |
47 | 39 | with:
|
48 |
| - node-version: 12.x |
| 40 | + java-version: 13.0.2 |
| 41 | + - name: Verify Java 13 |
| 42 | + if: runner.os != 'windows' |
| 43 | + run: __tests__/verify-java.sh 13.0.2 |
| 44 | + - name: Verify Java 13 (Windows) |
| 45 | + if: runner.os == 'windows' |
| 46 | + run: __tests__/verify-java.ps1 13.0.2 |
49 | 47 |
|
50 |
| - - name: npm install |
51 |
| - run: npm install |
52 |
| - |
53 |
| - - name: Lint |
54 |
| - run: npm run format-check |
| 48 | + test-proxy: |
| 49 | + runs-on: ubuntu-latest |
| 50 | + container: |
| 51 | + image: ubuntu:latest |
| 52 | + options: --dns 127.0.0.1 |
| 53 | + services: |
| 54 | + squid-proxy: |
| 55 | + image: datadog/squid:latest |
| 56 | + ports: |
| 57 | + - 3128:3128 |
| 58 | + env: |
| 59 | + https_proxy: http://squid-proxy:3128 |
| 60 | + steps: |
| 61 | + - uses: actions/checkout@v2 |
| 62 | + - name: Clear tool cache |
| 63 | + run: rm -rf $RUNNER_TOOL_CACHE/* |
| 64 | + - name: Setup Java 13 |
| 65 | + uses: ./ |
| 66 | + with: |
| 67 | + java-version: 13.0.2 |
| 68 | + - name: Verify Java 13 |
| 69 | + run: __tests__/verify-java.sh 13.0.2 |
55 | 70 |
|
56 |
| - - name: npm test |
57 |
| - run: npm test |
| 71 | + test-bypass-proxy: |
| 72 | + runs-on: ubuntu-latest |
| 73 | + env: |
| 74 | + https_proxy: http://no-such-proxy:3128 |
| 75 | + no_proxy: github.com,static.azul.com |
| 76 | + steps: |
| 77 | + - uses: actions/checkout@v2 |
| 78 | + - name: Clear tool cache |
| 79 | + run: rm -rf $RUNNER_TOOL_CACHE/* |
| 80 | + - name: Setup Java 13 |
| 81 | + uses: ./ |
| 82 | + with: |
| 83 | + java-version: 13.0.2 |
| 84 | + - name: Verify Java 13 |
| 85 | + run: __tests__/verify-java.sh 13.0.2 |
0 commit comments