Skip to content

Commit e6ce032

Browse files
claudekalwalt
authored andcommitted
ci: add GitHub Actions workflow for unit, build, and e2e
Two jobs that run on every PR and on pushes to dev/master: - unit (fast): npm ci + vitest. No emsdk, no wasm. - build-and-e2e: clones submodules, sets up emsdk via mymindstorm/setup-emsdk@v14 (cached), builds wasm (npm run build), builds JS bundles (npm run build-es6), installs Chromium, runs Playwright. Uploads the playwright-report/ directory on failure for triage. concurrency.cancel-in-progress lets a new push to the same PR abort the previous run automatically. No auto-publish on tag yet; release is still a manual npm publish. Refs #29 Refs #31
1 parent 7e5f896 commit e6ce032

1 file changed

Lines changed: 65 additions & 0 deletions

File tree

.github/workflows/ci.yml

Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
name: CI
2+
3+
on:
4+
push:
5+
branches: [dev, master]
6+
pull_request:
7+
branches: [dev, master]
8+
9+
# Cancel superseded runs on the same branch / PR.
10+
concurrency:
11+
group: ${{ github.workflow }}-${{ github.ref }}
12+
cancel-in-progress: true
13+
14+
jobs:
15+
unit:
16+
name: Unit tests (Vitest)
17+
runs-on: ubuntu-latest
18+
steps:
19+
- uses: actions/checkout@v4
20+
- uses: actions/setup-node@v4
21+
with:
22+
node-version: '22'
23+
cache: npm
24+
- run: npm ci
25+
- run: npm test
26+
27+
build-and-e2e:
28+
name: Build wasm + JS, run Playwright
29+
runs-on: ubuntu-latest
30+
steps:
31+
- uses: actions/checkout@v4
32+
with:
33+
submodules: recursive
34+
35+
- uses: actions/setup-node@v4
36+
with:
37+
node-version: '22'
38+
cache: npm
39+
40+
- uses: mymindstorm/setup-emsdk@v14
41+
with:
42+
version: 3.1.61
43+
actions-cache-folder: emsdk-cache
44+
45+
- run: npm ci
46+
47+
- name: Build wasm
48+
run: npm run build
49+
50+
- name: Build JS bundles
51+
run: npm run build-es6
52+
53+
- name: Install Playwright browsers
54+
run: npx playwright install --with-deps chromium
55+
56+
- name: Run Playwright e2e
57+
run: npm run test:e2e
58+
59+
- name: Upload Playwright report on failure
60+
if: failure()
61+
uses: actions/upload-artifact@v4
62+
with:
63+
name: playwright-report
64+
path: playwright-report/
65+
retention-days: 7

0 commit comments

Comments
 (0)