Skip to content

Commit 839a636

Browse files
committed
chore: add nodejs tests
1 parent f6aaa81 commit 839a636

File tree

2 files changed

+61
-23
lines changed

2 files changed

+61
-23
lines changed

.github/workflows/main.yml

Lines changed: 23 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,34 +1,34 @@
11
name: "CI: Test, Build, and Publish Package to npmjs"
22

33
on:
4-
release:
5-
types: [published]
4+
release:
5+
types: [published]
66

77
jobs:
8-
build-and-publish:
9-
runs-on: ubuntu-latest
10-
permissions:
11-
contents: read
12-
id-token: write
8+
build-and-publish:
9+
runs-on: ubuntu-latest
10+
permissions:
11+
contents: read
12+
id-token: write
1313

14-
steps:
15-
- uses: actions/checkout@v4
14+
steps:
15+
- uses: actions/checkout@v4
1616

17-
- uses: actions/setup-node@v4
18-
with:
19-
node-version: "20.x"
20-
registry-url: "https://registry.npmjs.org"
17+
- uses: actions/setup-node@v4
18+
with:
19+
node-version: "20.x"
20+
registry-url: "https://registry.npmjs.org"
2121

22-
- name: Install dependencies
23-
run: npm ci
22+
- name: Install dependencies
23+
run: npm ci
2424

25-
- name: Run tests
26-
run: npm test
25+
- name: Run tests
26+
run: npm test
2727

28-
- name: Build package
29-
run: npm run build
28+
- name: Build package
29+
run: npm run build
3030

31-
- name: Publish to npm
32-
run: npm publish --provenance --access public
33-
env:
34-
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
31+
- name: Publish to npm
32+
run: npm publish --provenance --access public
33+
env:
34+
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}

.github/workflows/test-node.yml

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
# Test package across all maintained/active/current versions of Node.js
2+
3+
name: "CI: Test (Node.js)"
4+
5+
on:
6+
push:
7+
branches:
8+
- "main"
9+
pull_request:
10+
11+
concurrency:
12+
group: node-build-${{ github.ref }}
13+
cancel-in-progress: true
14+
15+
jobs:
16+
build:
17+
runs-on: ubuntu-latest
18+
19+
strategy:
20+
fail-fast: false
21+
matrix:
22+
node-version: [20, 22, 24, 25]
23+
24+
steps:
25+
- name: Checkout repository
26+
uses: actions/checkout@v4
27+
28+
- name: Setup Node.js
29+
uses: actions/setup-node@v4
30+
with:
31+
node-version: ${{ matrix.node-version }}
32+
cache: npm
33+
34+
- name: Install dependencies
35+
run: npm ci
36+
37+
- name: Test
38+
run: npm test

0 commit comments

Comments
 (0)