Skip to content

Commit 5776575

Browse files
authored
ci: add node matrix (#20)
1 parent 15de413 commit 5776575

File tree

1 file changed

+16
-2
lines changed

1 file changed

+16
-2
lines changed

.github/workflows/run-tests.yml

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ on:
1010

1111
jobs:
1212
run-tests:
13-
name: Tests on ${{ matrix.os }}
13+
name: Tests on ${{ matrix.os }} with node ${{ matrix.node }}
1414
runs-on: ${{ matrix.os }}
1515
strategy:
1616
fail-fast: false
@@ -19,6 +19,9 @@ jobs:
1919
- ubuntu-latest
2020
- windows-latest
2121
- macos-latest
22+
node:
23+
- 22
24+
- 24
2225
steps:
2326
- name: Check out repository
2427
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
@@ -29,7 +32,7 @@ jobs:
2932
uses: actions/setup-node@a0853c24544627f65ddf259abe73b1d18a591444 # v5.0.0
3033
with:
3134
cache: npm
32-
node-version-file: '.nvmrc'
35+
node-version: ${{ matrix.node }}
3336

3437
- name: Install dependencies
3538
run: npm ci
@@ -40,3 +43,14 @@ jobs:
4043

4144
- name: Run tests
4245
run: npm run test
46+
47+
# Gating job for branch protection.
48+
test-success:
49+
name: '[Required] Tests passed'
50+
runs-on: ubuntu-latest
51+
needs: run-tests
52+
if: ${{ !cancelled() }}
53+
steps:
54+
- if: ${{ needs.run-tests.result != 'success' }}
55+
run: 'exit 1'
56+
- run: 'exit 0'

0 commit comments

Comments
 (0)