Skip to content

Commit 2eeae6f

Browse files
ndbroadbentclaude
andcommitted
Add Vite dev server and GitHub Actions CI
- Add Vite for frontend hot-reload during development - Configure Tauri to start Vite automatically (beforeDevCommand) - Add GitHub Actions workflow for CI (lint, test, build) - Workflow runs on macOS with Bun + Rust toolchain - Fix lefthook biome-lint glob to only check src/ files Now `task dev` and `task dev:prod` work correctly. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <[email protected]>
1 parent 3b8aa6f commit 2eeae6f

File tree

6 files changed

+280
-30
lines changed

6 files changed

+280
-30
lines changed

.github/workflows/ci.yml

Lines changed: 123 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,123 @@
1+
name: CI
2+
3+
on:
4+
push:
5+
branches: [main]
6+
pull_request:
7+
branches: [main]
8+
9+
env:
10+
CARGO_TERM_COLOR: always
11+
12+
jobs:
13+
check:
14+
name: Lint & Test
15+
runs-on: macos-latest
16+
steps:
17+
- uses: actions/checkout@v4
18+
19+
- name: Install Bun
20+
uses: oven-sh/setup-bun@v2
21+
with:
22+
bun-version: latest
23+
24+
- name: Install Rust
25+
uses: dtolnay/rust-toolchain@stable
26+
with:
27+
components: clippy, rustfmt
28+
29+
- name: Cache Cargo
30+
uses: actions/cache@v4
31+
with:
32+
path: |
33+
~/.cargo/bin/
34+
~/.cargo/registry/index/
35+
~/.cargo/registry/cache/
36+
~/.cargo/git/db/
37+
src-tauri/target/
38+
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
39+
restore-keys: ${{ runner.os }}-cargo-
40+
41+
- name: Cache Bun
42+
uses: actions/cache@v4
43+
with:
44+
path: ~/.bun/install/cache
45+
key: ${{ runner.os }}-bun-${{ hashFiles('**/bun.lock') }}
46+
restore-keys: ${{ runner.os }}-bun-
47+
48+
- name: Install dependencies
49+
run: bun install
50+
51+
- name: Build frontend
52+
run: bun run vite build
53+
54+
- name: TypeScript typecheck
55+
run: bunx tsc --noEmit
56+
57+
- name: Biome lint
58+
run: bunx biome check .
59+
60+
- name: Check biome-ignore comments
61+
run: |
62+
if grep -r "biome-ignore" --include="*.ts" --include="*.tsx" --include="*.js" src/ 2>/dev/null; then
63+
echo "❌ Found biome-ignore comments - these are forbidden!"
64+
exit 1
65+
fi
66+
echo "✅ No biome-ignore comments found"
67+
68+
- name: Check code duplication
69+
run: bunx jscpd src/
70+
71+
- name: Check file length
72+
run: ./scripts/check_file_length.sh
73+
74+
- name: Rust format check
75+
working-directory: src-tauri
76+
run: cargo fmt -- --check
77+
78+
- name: Rust clippy
79+
working-directory: src-tauri
80+
run: cargo clippy --all-targets --all-features -- -D warnings
81+
82+
- name: Rust tests
83+
working-directory: src-tauri
84+
run: cargo test
85+
86+
- name: TypeScript tests
87+
run: bunx vitest run
88+
89+
build:
90+
name: Build
91+
runs-on: macos-latest
92+
needs: check
93+
steps:
94+
- uses: actions/checkout@v4
95+
96+
- name: Install Bun
97+
uses: oven-sh/setup-bun@v2
98+
with:
99+
bun-version: latest
100+
101+
- name: Install Rust
102+
uses: dtolnay/rust-toolchain@stable
103+
104+
- name: Cache Cargo
105+
uses: actions/cache@v4
106+
with:
107+
path: |
108+
~/.cargo/bin/
109+
~/.cargo/registry/index/
110+
~/.cargo/registry/cache/
111+
~/.cargo/git/db/
112+
src-tauri/target/
113+
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
114+
restore-keys: ${{ runner.os }}-cargo-
115+
116+
- name: Install dependencies
117+
run: bun install
118+
119+
- name: Build Tauri app
120+
run: cargo tauri build
121+
env:
122+
TAURI_SIGNING_PRIVATE_KEY: ""
123+
TAURI_SIGNING_PRIVATE_KEY_PASSWORD: ""

0 commit comments

Comments
 (0)