|
1 | | -name: 'CI' |
| 1 | +name: Continuous Integration |
| 2 | + |
2 | 3 | on: |
3 | 4 | pull_request: |
4 | 5 | branches: [master] |
5 | 6 |
|
6 | 7 | jobs: |
7 | | - test_and_lint: |
8 | | - name: 'Test' |
| 8 | + test: |
| 9 | + name: Test |
9 | 10 | runs-on: ubuntu-latest |
10 | | - timeout-minutes: 5 |
11 | | - |
| 11 | + strategy: |
| 12 | + matrix: |
| 13 | + node-version: [14.x, 16.x, 18.x, 20.x] |
12 | 14 | steps: |
13 | 15 | - uses: actions/checkout@v2 |
14 | | - - uses: volta-cli/action@v1 |
15 | | - |
16 | | - - name: Get package manager's global cache path |
17 | | - id: global-cache-dir-path |
18 | | - run: echo "::set-output name=dir::$(yarn cache dir)" |
19 | | - |
20 | | - - name: Cache package manager's global cache and node_modules |
21 | | - id: cache-dependencies |
22 | | - uses: actions/cache@v2 |
| 16 | + - name: Use Node.js ${{ matrix.node-version }} |
| 17 | + uses: actions/setup-node@v3 |
23 | 18 | with: |
24 | | - path: | |
25 | | - ${{ steps.global-cache-dir-path.outputs.dir }} |
26 | | - node_modules |
27 | | - key: ${{ runner.os }}-${{ matrix.node-version }}-${{ |
28 | | - hashFiles('**/yarn.lock' |
29 | | - ) }} |
30 | | - restore-keys: | |
31 | | - ${{ runner.os }}-${{ matrix.node-version }}- |
| 19 | + node-version: ${{ matrix.node-version }} |
| 20 | + cache: 'yarn' |
| 21 | + - run: yarn install |
| 22 | + - run: yarn test |
32 | 23 |
|
33 | | - - name: Install |
34 | | - run: yarn install |
35 | | - |
36 | | - - name: Run tests and linting |
| 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 |
| 34 | + with: |
| 35 | + node-version: ${{ matrix.node-version }} |
| 36 | + cache: 'yarn' |
| 37 | + - name: install dependencies |
| 38 | + run: yarn install --no-lockfile |
| 39 | + - name: test |
37 | 40 | run: yarn test |
38 | | - |
39 | | - |
40 | | - |
41 | | - |
0 commit comments