Skip to content

Commit 9a3f185

Browse files
committed
ci: add CI workflow and gate npm publish on test suite
The repo had no CI; the only workflow (npm-publish.yml) published to npm on GitHub release without running any tests, so a broken branch could ship a release with provenance attached. - ci.yml: two jobs on push/PR to main and next - test (required): typecheck, biome check, unit tests, bundle-size regression, build - performance (continue-on-error): timing regression, informational only since shared runners are too noisy for assertions - npm-publish.yml: run bun run check (typecheck + biome check + tests + bundle regression) before Build package Both jobs use frozen-lockfile installs so PRs can't silently change dependencies. After merge, mark the test job as a required status check in GitHub branch protection for main and next.
1 parent f4d8ae4 commit 9a3f185

2 files changed

Lines changed: 58 additions & 0 deletions

File tree

.github/workflows/ci.yml

Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
name: CI
2+
3+
on:
4+
push:
5+
branches: [main, next]
6+
pull_request:
7+
branches: [main, next]
8+
9+
jobs:
10+
test:
11+
runs-on: ubuntu-latest
12+
steps:
13+
- name: Checkout repository
14+
uses: actions/checkout@v4
15+
16+
- name: Setup Bun
17+
uses: oven-sh/setup-bun@v1
18+
with:
19+
bun-version: latest
20+
21+
- name: Install dependencies
22+
run: bun install --frozen-lockfile
23+
24+
- name: Typecheck
25+
run: bunx tsc --noEmit
26+
27+
- name: Lint and format
28+
run: bunx biome check .
29+
30+
- name: Unit tests
31+
run: bun run test
32+
33+
- name: Bundle size regression
34+
run: bun test test/regression-bundle.test.ts
35+
36+
- name: Build
37+
run: bun run build
38+
39+
performance:
40+
runs-on: ubuntu-latest
41+
continue-on-error: true # informational only — shared runners are too noisy for timing assertions
42+
steps:
43+
- name: Checkout repository
44+
uses: actions/checkout@v4
45+
46+
- name: Setup Bun
47+
uses: oven-sh/setup-bun@v1
48+
with:
49+
bun-version: latest
50+
51+
- name: Install dependencies
52+
run: bun install --frozen-lockfile
53+
54+
- name: Performance regression (informational)
55+
run: bun test test/regression-performance.test.ts

.github/workflows/npm-publish.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,9 @@ jobs:
2222
- name: Install all dependencies (including devDependencies for build)
2323
run: bun install
2424

25+
- name: Typecheck, lint, test, and bundle regression
26+
run: bun run check
27+
2528
- name: Build package
2629
run: bun run build
2730

0 commit comments

Comments
 (0)