Skip to content

Commit 4f6d92a

Browse files
committed
ci: run the ci pipeline on different version of nodejs
1 parent a9190a0 commit 4f6d92a

File tree

3 files changed

+23
-36
lines changed

3 files changed

+23
-36
lines changed

.github/workflows/ci-build.yml

+12-24
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: "Build"
1+
name: "Build & Test"
22

33
on:
44
push:
@@ -13,18 +13,22 @@ concurrency:
1313

1414
jobs:
1515
build:
16-
name: Build
16+
name: Build & Test
1717
runs-on: ubuntu-latest
18-
18+
strategy:
19+
matrix:
20+
node-version: [18.x, 20.x, 22.x]
1921
timeout-minutes: 5
2022
steps:
21-
- uses: actions/checkout@v4
22-
- uses: actions/setup-node@v4
23+
- name: Check out repo
24+
uses: actions/checkout@v4
25+
26+
- name: Use Node.js ${{ matrix.node-version }}
27+
uses: actions/setup-node@v4
2328
with:
24-
node-version: 18
29+
node-version: ${{ matrix.node-version }}
2530
registry-url: https://registry.npmjs.org/
26-
# Skip post-install scripts here, as a malicious
27-
# script could steal NODE_AUTH_TOKEN.
31+
2832
- name: Install NPM dependencies
2933
run: npm install --ignore-scripts
3034

@@ -34,21 +38,5 @@ jobs:
3438
- name: Run tests
3539
run: npm run test-ci
3640

37-
pack:
38-
name: NPM Pack
39-
needs: build
40-
runs-on: ubuntu-latest
41-
42-
steps:
43-
- uses: actions/checkout@v4
44-
- uses: actions/setup-node@v4
45-
with:
46-
node-version: 18
47-
registry-url: https://registry.npmjs.org/
48-
# Skip post-install scripts here, as a malicious
49-
# script could steal NODE_AUTH_TOKEN.
50-
- name: Install NPM dependencies
51-
run: npm install --ignore-scripts --production
52-
5341
- name: Run NPM pack
5442
run: npm pack

.github/workflows/ci-codeql-analysis.yml

+3-3
Original file line numberDiff line numberDiff line change
@@ -25,11 +25,11 @@ jobs:
2525

2626
steps:
2727
- name: Checkout repository
28-
uses: actions/checkout@v3
28+
uses: actions/checkout@v4
2929

3030
# Initializes the CodeQL tools for scanning.
3131
- name: Initialize CodeQL
32-
uses: github/codeql-action/init@v2
32+
uses: github/codeql-action/init@v3
3333
with:
3434
languages: ${{ matrix.language }}
3535
# If you wish to specify custom queries, you can do so here or in a config file.
@@ -38,4 +38,4 @@ jobs:
3838
# queries: ./path/to/local/query, your-org/your-repo/queries@main
3939

4040
- name: Perform CodeQL Analysis
41-
uses: github/codeql-action/analyze@v2
41+
uses: github/codeql-action/analyze@v3

.github/workflows/ci-npm-publish.yml

+8-9
Original file line numberDiff line numberDiff line change
@@ -8,13 +8,14 @@ jobs:
88
build:
99
name: Build
1010
runs-on: ubuntu-latest
11-
1211
timeout-minutes: 5
1312
steps:
14-
- uses: actions/checkout@v4
13+
- name: Check out repo
14+
uses: actions/checkout@v4
15+
1516
- uses: actions/setup-node@v4
1617
with:
17-
node-version: 20
18+
node-version: 22
1819
registry-url: https://registry.npmjs.org/
1920
# Skip post-install scripts here, as a malicious
2021
# script could steal NODE_AUTH_TOKEN.
@@ -28,15 +29,13 @@ jobs:
2829
needs: build
2930
runs-on: ubuntu-latest
3031
steps:
31-
- uses: actions/checkout@v4
32+
- name: Check out repo
33+
uses: actions/checkout@v4
34+
3235
- uses: actions/setup-node@v4
3336
with:
34-
node-version: 20
37+
node-version: 22
3538
registry-url: https://registry.npmjs.org/
36-
# Skip post-install scripts here, as a malicious
37-
# script could steal NODE_AUTH_TOKEN.
38-
- name: Install NPM dependencies
39-
run: npm install --ignore-scripts --production
4039

4140
- name: Run NPM publish
4241
run: npm publish --access public

0 commit comments

Comments
 (0)