Skip to content

Commit 3119fb8

Browse files
committed
ci: add GitHub Actions workflow for automated testing
Added CI workflow that runs on push and pull requests: - Tests on Node.js 18.x, 20.x, and 22.x - Runs typecheck, lint, build, and tests - Separate job for test coverage reporting - Uses npm ci for faster, reproducible builds - Caches node_modules for improved performance
1 parent 20bc05f commit 3119fb8

File tree

1 file changed

+61
-0
lines changed

1 file changed

+61
-0
lines changed

.github/workflows/ci.yml

Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
name: CI
2+
3+
on:
4+
push:
5+
branches: [main]
6+
pull_request:
7+
branches: [main]
8+
9+
jobs:
10+
test:
11+
name: Test on Node.js ${{ matrix.node-version }}
12+
runs-on: ubuntu-latest
13+
14+
strategy:
15+
matrix:
16+
node-version: [18.x, 20.x, 22.x]
17+
18+
steps:
19+
- name: Checkout code
20+
uses: actions/checkout@v4
21+
22+
- name: Setup Node.js ${{ matrix.node-version }}
23+
uses: actions/setup-node@v4
24+
with:
25+
node-version: ${{ matrix.node-version }}
26+
cache: 'npm'
27+
28+
- name: Install dependencies
29+
run: npm ci
30+
31+
- name: Type check
32+
run: npm run typecheck
33+
34+
- name: Lint
35+
run: npm run lint
36+
37+
- name: Build
38+
run: npm run build
39+
40+
- name: Run tests
41+
run: npm test -- --run
42+
43+
coverage:
44+
name: Test Coverage
45+
runs-on: ubuntu-latest
46+
47+
steps:
48+
- name: Checkout code
49+
uses: actions/checkout@v4
50+
51+
- name: Setup Node.js
52+
uses: actions/setup-node@v4
53+
with:
54+
node-version: 20.x
55+
cache: 'npm'
56+
57+
- name: Install dependencies
58+
run: npm ci
59+
60+
- name: Run tests with coverage
61+
run: npm test -- --run --coverage

0 commit comments

Comments
 (0)