Skip to content

Commit c07d0e7

Browse files
committed
Add GitHub Actions CI workflow
- Run tests on push to main and add-tests branches - Test on Node.js 18.x, 20.x, and 22.x - Run tests, build, and prettier formatting checks - Use npm ci for faster, reliable installs - Trigger on pull requests to main branch
1 parent 1804807 commit c07d0e7

File tree

1 file changed

+37
-0
lines changed

1 file changed

+37
-0
lines changed

.github/workflows/ci.yml

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
name: CI
2+
3+
on:
4+
push:
5+
branches: [ main, add-tests ]
6+
pull_request:
7+
branches: [ 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 code
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 run test:run
32+
33+
- name: Run build
34+
run: npm run build
35+
36+
- name: Check formatting
37+
run: npm run prettier:check

0 commit comments

Comments
 (0)