Skip to content

Commit b5cef7f

Browse files
authored
Merge pull request #35 from webarkit/feat-test-improves
provide tests and CI to the project
2 parents ecd38b6 + 839bedc commit b5cef7f

9 files changed

Lines changed: 1373 additions & 20 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

.gitignore

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,3 +2,8 @@ node_modules
22
build/libar.bc
33
build/libar.o
44
doc/*
5+
# Test outputs
6+
test-results/
7+
playwright-report/
8+
playwright/.cache/
9+
coverage/

0 commit comments

Comments
 (0)