|
1 | | -name: CI |
| 1 | +name: Continuous Integration |
2 | 2 |
|
3 | 3 | on: |
4 | 4 | push: |
5 | | - branches: |
6 | | - - master |
7 | 5 | pull_request: |
8 | 6 |
|
9 | | -env: |
10 | | - NODE_VERSION: '12.x' |
11 | | - |
12 | 7 | jobs: |
13 | 8 | test: |
14 | | - name: Tests |
| 9 | + name: Test |
15 | 10 | runs-on: ubuntu-latest |
16 | | - |
| 11 | + strategy: |
| 12 | + matrix: |
| 13 | + node-version: [14.x, 16.x, 18.x, 20.x] |
17 | 14 | steps: |
18 | 15 | - uses: actions/checkout@v2 |
| 16 | + - name: Use Node.js ${{ matrix.node-version }} |
| 17 | + uses: actions/setup-node@v3 |
19 | 18 | with: |
20 | | - fetch-depth: 1 |
21 | | - |
22 | | - - uses: actions/setup-node@v2-beta |
23 | | - with: |
24 | | - node-version: '${{ env.NODE_VERSION }}' |
25 | | - |
26 | | - - name: Get package manager's global cache path |
27 | | - id: global-cache-dir-path |
28 | | - run: echo "::set-output name=dir::$(yarn cache dir)" |
| 19 | + node-version: ${{ matrix.node-version }} |
| 20 | + cache: 'yarn' |
| 21 | + - run: yarn install |
| 22 | + - run: yarn test |
29 | 23 |
|
30 | | - - name: Cache package manager's global cache and node_modules |
31 | | - id: cache-dependencies |
32 | | - uses: actions/cache@v2 |
| 24 | + test-floating: |
| 25 | + name: Floating Dependencies |
| 26 | + runs-on: ubuntu-latest |
| 27 | + strategy: |
| 28 | + matrix: |
| 29 | + node-version: [14.x, 16.x, 18.x, 20.x] |
| 30 | + steps: |
| 31 | + - uses: actions/checkout@v2 |
| 32 | + - name: Use Node.js ${{ matrix.node-version }} |
| 33 | + uses: actions/setup-node@v3 |
33 | 34 | with: |
34 | | - path: | |
35 | | - ${{ steps.global-cache-dir-path.outputs.dir }} |
36 | | - node_modules |
37 | | - key: v1-${{ runner.os }}-${{ matrix.node-version }}-${{ |
38 | | - hashFiles('**/yarn.lock' |
39 | | - ) }} |
40 | | - restore-keys: | |
41 | | - v1-${{ runner.os }}-${{ matrix.node-version }}- |
42 | | -
|
43 | | - - name: Install Dependencies |
| 35 | + node-version: ${{ matrix.node-version }} |
| 36 | + cache: 'yarn' |
| 37 | + - name: install dependencies |
44 | 38 | run: yarn install --no-lockfile |
45 | | - if: | |
46 | | - steps.cache-dependencies.outputs.cache-hit != 'true' |
47 | | -
|
48 | | - - name: Test |
| 39 | + - name: test |
49 | 40 | run: yarn test |
50 | | - |
51 | | - |
0 commit comments