Skip to content

Commit 7656b97

Browse files
thingnoyclaude
andcommitted
ci: run integration tests before publish + on push/PR
Add .github/workflows/ci.yml running typecheck + build + 11 node:test integration tests on push and PR to main, so broken tests block merge instead of waiting for a release attempt to surface them. Add test step to release.yml between build and npm publish, so a broken build can never ship to npm even if someone pushes a tag. Add build + test to scripts/release.sh preflight, so local releases fail fast before the version bump and git tag — no more broken tags to clean up. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent f86e1b2 commit 7656b97

3 files changed

Lines changed: 40 additions & 2 deletions

File tree

‎.github/workflows/ci.yml‎

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
name: CI
2+
3+
on:
4+
push:
5+
branches: [main]
6+
pull_request:
7+
branches: [main]
8+
9+
jobs:
10+
test:
11+
runs-on: ubuntu-latest
12+
steps:
13+
- uses: actions/checkout@v4
14+
15+
- uses: actions/setup-node@v4
16+
with:
17+
node-version: 22
18+
19+
- name: Install dependencies
20+
run: npm ci
21+
22+
- name: Typecheck
23+
run: npm run typecheck
24+
25+
- name: Build
26+
run: npm run build
27+
28+
- name: Integration tests
29+
run: node --test test/*.test.mjs

‎.github/workflows/release.yml‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,9 @@ jobs:
2727
- name: Build
2828
run: npm run build
2929

30+
- name: Integration tests
31+
run: node --test test/*.test.mjs
32+
3033
- name: Publish to npm
3134
run: npm publish --access public
3235
env:

‎scripts/release.sh‎

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,15 +33,21 @@ if [ "$BRANCH" != "main" ]; then
3333
if [ "$answer" != "y" ]; then exit 1; fi
3434
fi
3535

36+
# ── Pre-release test ──
37+
echo ""
38+
echo "── Build + test ──"
39+
npm run build
40+
node --test test/*.test.mjs
41+
3642
# ── Version bump ──
3743
echo ""
3844
echo "── Version bump ($BUMP) ──"
3945
NEW_VERSION=$(npm version $BUMP --no-git-tag-version)
4046
echo "New version: $NEW_VERSION"
4147

42-
# ── Build ──
48+
# ── Rebuild so dist reflects the bumped package.json ──
4349
echo ""
44-
echo "── Build ──"
50+
echo "── Rebuild ──"
4551
npm run build
4652

4753
# ── Update screenshots (if demo report exists) ──

0 commit comments

Comments
 (0)