|
4 | 4 | workflow_call:
|
5 | 5 |
|
6 | 6 | jobs:
|
| 7 | + prepare: |
| 8 | + name: Prepare |
| 9 | + runs-on: ubuntu-latest |
| 10 | + strategy: |
| 11 | + matrix: |
| 12 | + node-version: [18.x, 20.x, 22.x] |
| 13 | + steps: |
| 14 | + - uses: actions/checkout@v4 |
| 15 | + - name: Use Node.js ${{ matrix.node-version }} |
| 16 | + uses: actions/setup-node@v4 |
| 17 | + with: |
| 18 | + node-version-file: '.nvmrc' |
| 19 | + - name: Install dependencies |
| 20 | + run: npm ci |
| 21 | + |
7 | 22 | build:
|
8 | 23 | name: Build
|
| 24 | + needs: prepare |
9 | 25 | runs-on: ubuntu-latest
|
10 | 26 | strategy:
|
11 | 27 | matrix:
|
12 |
| - node-version: [10.x, 12.x, 14.x, 16.x, 18.x, 20.x] |
| 28 | + node-version: [22.x] |
13 | 29 | steps:
|
14 |
| - - uses: actions/checkout@v3 |
| 30 | + - uses: actions/checkout@v4 |
15 | 31 | - name: Use Node.js ${{ matrix.node-version }}
|
16 |
| - uses: actions/setup-node@v3 |
| 32 | + uses: actions/setup-node@v4 |
17 | 33 | with:
|
18 |
| - node-version: ${{ matrix.node-version }} |
19 |
| - cache: 'npm' |
20 |
| - - run: npm i -g npm@6 |
21 |
| - - run: npm i |
| 34 | + node-version-file: '.nvmrc' |
| 35 | + - run: npm ci |
22 | 36 | - run: npm run build
|
23 | 37 | - name: Require clean working directory
|
24 | 38 | shell: bash
|
25 | 39 | run: |
|
26 |
| - if ! git diff --exit-code -- . ':!dist/*.map'; then |
| 40 | + if ! git diff --exit-code; then |
27 | 41 | echo "Working tree dirty at end of job"
|
28 | 42 | exit 1
|
29 | 43 | fi
|
30 | 44 |
|
31 | 45 | lint:
|
32 | 46 | name: Lint
|
| 47 | + needs: prepare |
33 | 48 | runs-on: ubuntu-latest
|
34 | 49 | strategy:
|
35 | 50 | matrix:
|
36 |
| - node-version: [12.x] |
| 51 | + node-version: [22.x] |
37 | 52 | steps:
|
38 |
| - - uses: actions/checkout@v3 |
| 53 | + - uses: actions/checkout@v4 |
39 | 54 | - name: Use Node.js ${{ matrix.node-version }}
|
40 |
| - uses: actions/setup-node@v3 |
| 55 | + uses: actions/setup-node@v4 |
41 | 56 | with:
|
42 |
| - node-version: ${{ matrix.node-version }} |
43 |
| - cache: 'npm' |
44 |
| - - run: npm i -g npm@6 |
45 |
| - - run: npm i |
| 57 | + node-version-file: '.nvmrc' |
| 58 | + - run: npm ci |
46 | 59 | - run: npm run lint
|
| 60 | + - name: Require clean working directory |
| 61 | + shell: bash |
| 62 | + run: | |
| 63 | + if ! git diff --exit-code; then |
| 64 | + echo "Working tree dirty at end of job" |
| 65 | + exit 1 |
| 66 | + fi |
47 | 67 |
|
48 | 68 | test:
|
49 | 69 | name: Test
|
| 70 | + needs: prepare |
50 | 71 | runs-on: ubuntu-latest
|
51 | 72 | strategy:
|
52 | 73 | matrix:
|
53 |
| - node-version: [10.x, 12.x, 14.x, 16.x, 18.x, 20.x] |
| 74 | + node-version: [18.x, 20.x, 22.x] |
54 | 75 | steps:
|
55 |
| - - uses: actions/checkout@v3 |
| 76 | + - uses: actions/checkout@v4 |
56 | 77 | - name: Use Node.js ${{ matrix.node-version }}
|
57 |
| - uses: actions/setup-node@v3 |
| 78 | + uses: actions/setup-node@v4 |
58 | 79 | with:
|
59 |
| - node-version: ${{ matrix.node-version }} |
60 |
| - cache: 'npm' |
61 |
| - - run: npm i -g npm@6 |
62 |
| - - run: npm i |
| 80 | + node-version-file: '.nvmrc' |
| 81 | + - run: npm ci |
63 | 82 | - run: npm run test
|
64 | 83 | - name: Require clean working directory
|
65 | 84 | shell: bash
|
66 | 85 | run: |
|
67 |
| - if ! git diff --exit-code -- . ':!dist/*.map' ':!package-lock.json' ; then |
| 86 | + if ! git diff --exit-code; then |
68 | 87 | echo "Working tree dirty at end of job"
|
69 | 88 | exit 1
|
70 | 89 | fi
|
0 commit comments