Skip to content

Commit 6c2bf57

Browse files
authored
Add unit test GitHub Action (#4)
1 parent 5b80bf4 commit 6c2bf57

File tree

1 file changed

+41
-0
lines changed

1 file changed

+41
-0
lines changed

.github/workflows/unittest.yml

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
name: JavaScript Unit Test
2+
on:
3+
push:
4+
paths:
5+
- 'src/**'
6+
pull_request:
7+
paths:
8+
- 'src/**'
9+
permissions:
10+
contents: read
11+
12+
jobs:
13+
nodejs-unittest:
14+
runs-on: ${{ matrix.os }}
15+
strategy:
16+
fail-fast: false
17+
matrix:
18+
os: [ubuntu-latest, macos-latest, windows-latest]
19+
node-version: [20, 22]
20+
21+
steps:
22+
- name: Harden Runner
23+
uses: step-security/harden-runner@0080882f6c36860b6ba35c610c98ce87d4e2f26f # v2.10.2
24+
with:
25+
egress-policy: audit
26+
27+
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
28+
29+
- name: Setup Node ${{ matrix.node-version }}
30+
uses: actions/setup-node@39370e3970a6d050c480ffad4ff0ed4d3fdee5af # v4.1.0
31+
with:
32+
node-version: ${{ matrix.node-version }}
33+
34+
- name: Install Dependencies
35+
run: npm install
36+
37+
- name: Build
38+
run: npm run build
39+
40+
- name: Run test
41+
run: npm test

0 commit comments

Comments
 (0)