Skip to content

Commit e647452

Browse files
committed
ci: add GitHub Actions workflow for running tests
- Run tests on push and pull requests to master/main - Test against Node.js 18.x, 20.x, and 22.x - Generate coverage report on Node 20.x - Uses npm ci for faster, reliable installs
1 parent 1921a8f commit e647452

1 file changed

Lines changed: 35 additions & 0 deletions

File tree

.github/workflows/tests.yml

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
name: Tests
2+
3+
on:
4+
push:
5+
branches: [master, main]
6+
pull_request:
7+
branches: [master, main]
8+
9+
jobs:
10+
test:
11+
runs-on: ubuntu-latest
12+
13+
strategy:
14+
matrix:
15+
node-version: [18.x, 20.x, 22.x]
16+
17+
steps:
18+
- name: Checkout repository
19+
uses: actions/checkout@v4
20+
21+
- name: Setup Node.js ${{ matrix.node-version }}
22+
uses: actions/setup-node@v4
23+
with:
24+
node-version: ${{ matrix.node-version }}
25+
cache: 'npm'
26+
27+
- name: Install dependencies
28+
run: npm ci
29+
30+
- name: Run tests
31+
run: npm test
32+
33+
- name: Run tests with coverage
34+
if: matrix.node-version == '20.x'
35+
run: npm run test:coverage

0 commit comments

Comments
 (0)