Skip to content

Commit da5c1aa

Browse files
frenchie4111claude
andauthored
ci: run typecheck + build + tests on every PR (#66)
Adds a GitHub Actions workflow that runs npm run typecheck, npx electron-vite build, and npx vitest run on every PR (and on pushes to main as a safety net). Previously these only ran locally, so PRs could land with broken types or tests if the author skipped the pre-commit ritual. Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
1 parent e77cb57 commit da5c1aa

2 files changed

Lines changed: 45 additions & 0 deletions

File tree

.github/workflows/ci.yml

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
name: CI
2+
3+
on:
4+
pull_request:
5+
push:
6+
branches: [main]
7+
8+
# Cancel an in-flight CI run when a new commit lands on the same branch.
9+
# Saves CI minutes during rapid pushes; the latest commit is what matters.
10+
concurrency:
11+
group: ci-${{ github.workflow }}-${{ github.ref }}
12+
cancel-in-progress: ${{ github.event_name == 'pull_request' }}
13+
14+
jobs:
15+
ci:
16+
runs-on: ubuntu-latest
17+
steps:
18+
- uses: actions/checkout@v4
19+
20+
- uses: actions/setup-node@v4
21+
with:
22+
node-version: '20'
23+
cache: 'npm'
24+
25+
# --legacy-peer-deps because electron-vite@5 declares a peer range
26+
# that npm's strict resolver rejects against the installed vite@7.
27+
# Matches the developer-facing install instructions.
28+
- name: Install dependencies
29+
run: npm install --legacy-peer-deps
30+
31+
# electron-vite build does NOT run tsc on its own — so typecheck
32+
# is a separate, required gate.
33+
- name: Typecheck
34+
run: npm run typecheck
35+
36+
# Catches missing imports, asset resolution errors, and other
37+
# bundler-level issues that tsc alone misses.
38+
- name: Build
39+
run: npx electron-vite build
40+
41+
- name: Tests
42+
run: npx vitest run

CLAUDE.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -467,6 +467,9 @@ These are how the user wants Claude to behave when working on this repo:
467467
- `npx electron-vite build` — catches missing imports, asset resolution,
468468
and other bundler-level issues.
469469
Run `npx vitest run` too if the change could affect reducer/FSM behavior.
470+
PR-time CI (`.github/workflows/ci.yml`) runs all three on every PR as a
471+
safety net, but the local pre-commit ritual still catches issues before
472+
you push.
470473

471474
4. **Don't add comments unless asked.** Code should explain itself; comments
472475
are reserved for non-obvious "why" notes. The exception is the comment

0 commit comments

Comments
 (0)