Skip to content

Commit 1925292

Browse files
srsholmesclaude
andcommitted
ci: add GitHub Actions workflow for unit and E2E tests
Runs build, Vitest unit tests, and Playwright E2E tests on push/PR to main and develop branches. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent 4f36357 commit 1925292

File tree

1 file changed

+76
-0
lines changed

1 file changed

+76
-0
lines changed

.github/workflows/ci.yml

Lines changed: 76 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,76 @@
1+
name: CI
2+
3+
on:
4+
push:
5+
branches: [main, develop]
6+
pull_request:
7+
branches: [main, develop]
8+
9+
jobs:
10+
build:
11+
runs-on: ubuntu-latest
12+
steps:
13+
- uses: actions/checkout@v4
14+
15+
- uses: actions/setup-node@v4
16+
with:
17+
node-version: 20
18+
cache: npm
19+
20+
- name: Install dependencies
21+
run: npm ci
22+
23+
- name: Build library
24+
run: npm run rollup
25+
26+
unit-tests:
27+
runs-on: ubuntu-latest
28+
needs: build
29+
steps:
30+
- uses: actions/checkout@v4
31+
32+
- uses: actions/setup-node@v4
33+
with:
34+
node-version: 20
35+
cache: npm
36+
37+
- name: Install dependencies
38+
run: npm ci
39+
40+
- name: Run unit tests
41+
run: npm test
42+
43+
e2e-tests:
44+
runs-on: ubuntu-latest
45+
needs: build
46+
steps:
47+
- uses: actions/checkout@v4
48+
49+
- uses: actions/setup-node@v4
50+
with:
51+
node-version: 20
52+
cache: npm
53+
54+
- name: Install dependencies
55+
run: npm ci
56+
57+
- name: Build library
58+
run: npm run rollup
59+
60+
- name: Install example dependencies
61+
run: npm ci
62+
working-directory: example
63+
64+
- name: Install Playwright browsers
65+
run: npx playwright install chromium --with-deps
66+
67+
- name: Run E2E tests
68+
run: npm run test:e2e
69+
70+
- name: Upload test results
71+
if: ${{ !cancelled() }}
72+
uses: actions/upload-artifact@v4
73+
with:
74+
name: playwright-report
75+
path: test-results/
76+
retention-days: 7

0 commit comments

Comments
 (0)