@@ -8,7 +8,13 @@ name: Test
88 types :
99 - opened
1010 - synchronize
11+
12+ env :
13+ FORCE_COLOR : 1
14+ NPM_CONFIG_COLOR : always
15+
1116jobs :
17+ # verify against ranges defined as supported in engines.node
1218 test_matrix :
1319 strategy :
1420 matrix :
@@ -27,21 +33,39 @@ jobs:
2733 node-version : " ${{ matrix.node-version }}"
2834 cache : npm
2935 - run : npm clean-install
36+ - run : npm audit signatures
3037 - run : npm test
31- test :
38+
39+ # verify against the node version defined for development in the .nvmrc
40+ test_dev :
3241 runs-on : ubuntu-latest
33- needs : test_matrix
42+ timeout-minutes : 5
43+
3444 steps :
35- - uses : actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
36- - uses : actions/setup-node@1a4442cacd436585916779262731d5b162bc6ec7 # v3
45+ - uses : actions/checkout@3df4ab11eba7bda6032a0b82a6bb43b11571feac # v4
46+ - run : git config --global user.name github-actions
47+ - run : git config --global user.email github-actions@github.com
48+ - name : Use Node.js from .nvmrc
49+ uses : actions/setup-node@5e21ff4d9bc1a8cf6de233a3057d20ec6b3fb69d # v3
3750 with :
38- node-version : " lts/* "
51+ node-version-file : .nvmrc
3952 cache : npm
4053 - run : npm clean-install
4154 - run : npm audit signatures
42- - name : Ensure dependencies are compatible with the version of node
43- run : npx ls-engines
44- - run : npm run lint
45- # https://github.com/lirantal/lockfile-lint#readme
46- - name : Scan lockfile for security issues
47- run : npx lockfile-lint --path package-lock.json
55+ - run : npm test
56+
57+ # separate job to set as required in branch protection,
58+ # as the build names above change each time Node versions change
59+ test :
60+ runs-on : ubuntu-latest
61+ needs :
62+ - test_dev
63+ - test_matrix
64+ if : always()
65+ steps :
66+ - name : All matrix versions passed
67+ if : ${{ !(contains(needs.*.result, 'failure')) }}
68+ run : exit 0
69+ - name : Some matrix version failed
70+ if : ${{ contains(needs.*.result, 'failure') }}
71+ run : exit 1
0 commit comments