Skip to content

Commit fd47ccc

Browse files
committed
chore: add GitHub Actions CI pipeline and bundle analyzer
Add CI workflow (lint → test with coverage → build) triggered on push to dev/main and PRs to main. Add rollup-plugin-visualizer behind --mode analyze for on-demand bundle treemap analysis. Coverage thresholds (75% stmts, 78% branches, 75% lines) enforce regression detection both locally and in CI.
1 parent 6f9292a commit fd47ccc

File tree

6 files changed

+352
-10
lines changed

6 files changed

+352
-10
lines changed

.github/workflows/ci.yml

Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
name: CI
2+
3+
on:
4+
push:
5+
branches: [dev, main]
6+
pull_request:
7+
branches: [main]
8+
9+
concurrency:
10+
group: ci-${{ github.ref }}
11+
cancel-in-progress: true
12+
13+
jobs:
14+
ci:
15+
name: Lint, Test & Build
16+
runs-on: ubuntu-latest
17+
18+
steps:
19+
- name: Checkout
20+
uses: actions/checkout@v4
21+
22+
- name: Setup Node.js
23+
uses: actions/setup-node@v4
24+
with:
25+
node-version: 22
26+
cache: npm
27+
28+
- name: Install dependencies
29+
run: npm ci
30+
31+
- name: Lint
32+
run: npm run lint
33+
34+
- name: Test with coverage
35+
run: npm test -- --coverage
36+
37+
- name: Coverage summary
38+
if: always()
39+
run: |
40+
echo '## Test Coverage' >> $GITHUB_STEP_SUMMARY
41+
echo '' >> $GITHUB_STEP_SUMMARY
42+
if [ -f coverage/coverage-summary.json ]; then
43+
node -e "
44+
const c = require('./coverage/coverage-summary.json').total;
45+
const fmt = (m) => m.pct + '%';
46+
console.log('| Metric | Coverage |');
47+
console.log('|--------|----------|');
48+
console.log('| Statements | ' + fmt(c.statements) + ' |');
49+
console.log('| Branches | ' + fmt(c.branches) + ' |');
50+
console.log('| Functions | ' + fmt(c.functions) + ' |');
51+
console.log('| Lines | ' + fmt(c.lines) + ' |');
52+
" >> $GITHUB_STEP_SUMMARY
53+
else
54+
echo '_Coverage summary not available._' >> $GITHUB_STEP_SUMMARY
55+
fi
56+
57+
- name: Build
58+
run: npm run build

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ node_modules
1111
dist
1212
dist-ssr
1313
coverage
14+
stats.html
1415
*.local
1516

1617
# Claude Code

0 commit comments

Comments
 (0)