|
1 | 1 | name: CI
|
2 | 2 | on: [push, pull_request]
|
3 |
| -jobs: |
4 | 3 |
|
| 4 | +concurrency: |
| 5 | + group: ${{ github.workflow }}-${{ github.ref }} |
| 6 | + cancel-in-progress: true |
| 7 | + |
| 8 | +env: |
| 9 | + DEFAULT_NODE_VERSION: 22.x |
| 10 | + |
| 11 | +jobs: |
5 | 12 | lint:
|
| 13 | + name: Lint |
6 | 14 | runs-on: ubuntu-latest
|
7 | 15 | steps:
|
8 |
| - - uses: actions/checkout@v2 |
9 |
| - - uses: actions/cache@v2 |
| 16 | + - name: Use Node.js ${{ env.DEFAULT_NODE_VERSION }} |
| 17 | + uses: actions/setup-node@v4 |
10 | 18 | with:
|
11 |
| - path: '**/node_modules' |
12 |
| - key: ${{ runner.os }}-lint-modules-${{ hashFiles('**/yarn.lock') }} |
13 |
| - - uses: actions/setup-node@v2 |
| 19 | + node-version: ${{ env.DEFAULT_NODE_VERSION }} |
| 20 | + - name: Enable corepack |
| 21 | + run: corepack enable |
| 22 | + - name: Ensure line endings are consistent |
| 23 | + run: git config --global core.autocrlf input |
| 24 | + - name: Checkout repository |
| 25 | + uses: actions/checkout@v4 |
| 26 | + - name: Load dependency cache |
| 27 | + uses: actions/cache@v4 |
14 | 28 | with:
|
15 |
| - node-version: 20.x |
16 |
| - - run: corepack enable |
17 |
| - - run: yarn install |
18 |
| - - run: yarn run lint |
19 |
| - |
| 29 | + path: .yarn |
| 30 | + key: ${{ runner.os }}-modules-${{ hashFiles('yarn.lock') }} |
| 31 | + - name: Install dependencies |
| 32 | + run: yarn install --immutable |
| 33 | + - name: Run ESLint |
| 34 | + run: yarn run lint |
20 | 35 | test:
|
| 36 | + name: Test |
| 37 | + needs: lint |
21 | 38 | runs-on: ${{ matrix.os }}
|
22 | 39 | strategy:
|
23 | 40 | matrix:
|
24 |
| - os: [ubuntu-latest, windows-latest, macos-latest] |
| 41 | + os: |
| 42 | + - ubuntu-latest |
| 43 | + - windows-latest |
| 44 | + - macos-latest |
25 | 45 | node-version:
|
26 | 46 | - 18.x
|
27 | 47 | - 20.x
|
28 |
| - - 21.x |
| 48 | + - 22.x |
29 | 49 | steps:
|
30 | 50 | - name: Use Node.js ${{ matrix.node-version }}
|
31 |
| - uses: actions/setup-node@v2 |
| 51 | + uses: actions/setup-node@v4 |
32 | 52 | with:
|
33 | 53 | node-version: ${{ matrix.node-version }}
|
34 |
| - - name: Enable CorePack |
| 54 | + - name: Enable corepack |
35 | 55 | run: corepack enable
|
36 | 56 | - name: Ensure line endings are consistent
|
37 | 57 | run: git config --global core.autocrlf input
|
38 |
| - - name: Check out repository |
39 |
| - uses: actions/checkout@v2 |
40 |
| - - uses: actions/cache@v2 |
| 58 | + - name: Checkout repository |
| 59 | + uses: actions/checkout@v4 |
| 60 | + - name: Load dependency cache |
| 61 | + uses: actions/cache@v4 |
41 | 62 | with:
|
42 |
| - path: '**/node_modules' |
43 |
| - key: ${{ runner.os }}-test-modules-${{ hashFiles('**/yarn.lock') }} |
| 63 | + path: .yarn |
| 64 | + key: ${{ runner.os }}-modules-${{ hashFiles('yarn.lock') }} |
44 | 65 | - name: Install dependencies
|
45 |
| - run: yarn install |
| 66 | + run: yarn install --immutable |
46 | 67 | - name: Build project
|
47 | 68 | run: yarn run build
|
48 | 69 | - name: Run tests
|
49 | 70 | run: yarn run test
|
50 | 71 | - name: Submit coverage results
|
51 |
| - uses: coverallsapp/github-action@master |
| 72 | + uses: coverallsapp/github-action@v2 |
52 | 73 | with:
|
53 | 74 | github-token: ${{ secrets.github_token }}
|
54 |
| - flag-name: run-${{ matrix.node-version }} |
| 75 | + flag-name: ${{ matrix.node-version }}-${{ matrix.os }} |
55 | 76 | parallel: true
|
56 |
| - |
57 | 77 | coveralls:
|
| 78 | + name: Coverage |
58 | 79 | needs: test
|
59 | 80 | runs-on: ubuntu-latest
|
60 | 81 | steps:
|
61 | 82 | - name: Consolidate test coverage from different jobs
|
62 |
| - uses: coverallsapp/github-action@master |
| 83 | + uses: coverallsapp/github-action@v2 |
63 | 84 | with:
|
64 | 85 | github-token: ${{ secrets.github_token }}
|
65 | 86 | parallel-finished: true
|
0 commit comments