Skip to content

Commit 79fa9d3

Browse files
committed
update ci script to use matrix strategy
1 parent a28bc70 commit 79fa9d3

File tree

1 file changed

+14
-6
lines changed

1 file changed

+14
-6
lines changed

.github/workflows/ci.yml

Lines changed: 14 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -17,24 +17,32 @@ jobs:
1717
# The type of runner that the job will run on
1818
runs-on: ubuntu-latest
1919

20+
# Use matrix strategy to test multiple Node.js versions
21+
strategy:
22+
matrix:
23+
node-version: [18.x, 20.x, 22.x]
24+
# See supported Node.js release schedule at https://nodejs.org/en/about/releases/
25+
2026
# Steps represent a sequence of tasks that will be executed as part of the job
2127
steps:
2228
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
23-
- uses: actions/checkout@v3
24-
- uses: actions/setup-node@v4
29+
- uses: actions/checkout@v4
30+
31+
- name: Use Node.js ${{ matrix.node-version }}
32+
uses: actions/setup-node@v4
2533
with:
26-
node-version: "18.x"
34+
node-version: ${{ matrix.node-version }}
2735

2836
- name: Install dependencies
2937
run: npm install
3038

31-
- name: Run tests
32-
run: npm test
33-
3439
- name: Dry-run build
3540
run: npm run build
3641
env:
3742
# These env variables must be set in the repository's secrets
3843
# - Settings -> Secrets and variables -> New repository secret
3944
MONGO_URI: ${{ secrets.MONGO_URI }}
4045
# Add additional environment variables here
46+
47+
- name: Run tests
48+
run: npm test

0 commit comments

Comments
 (0)