Skip to content

Commit d8a0dd3

Browse files
calliclesclaude
andauthored
Add CI workflow for linting, type checking, and testing (#3)
* Add GitHub Actions CI workflow for lint, type-check, and tests Adds .github/workflows/ci.yml with four jobs that run on every pull request and push to main: - lint: Biome lint & format check (pnpm lint) - type-check: TypeScript strict type check (tsc --noEmit) - test-unit: Vitest unit tests (pnpm test:unit) - test-integration: Vitest integration tests (pnpm test:integration), conditional on DATABASE_URL secret being configured (requires a Neon PostgreSQL URL since the app uses @neondatabase/serverless) Concurrent runs for the same ref are cancelled to avoid redundant CI usage. https://claude.ai/code/session_0179RDnpCGY9iMg6yR5QBFFK * Update GitHub Actions to latest major versions - actions/checkout: v4 → v6 (latest: v6.0.2) - actions/setup-node: v4 → v6 (latest: v6.2.0) - pnpm/action-setup: already at latest (v4, v4.2.0) https://claude.ai/code/session_0179RDnpCGY9iMg6yR5QBFFK --------- Co-authored-by: Claude <noreply@anthropic.com>
1 parent a0cb839 commit d8a0dd3

1 file changed

Lines changed: 108 additions & 0 deletions

File tree

.github/workflows/ci.yml

Lines changed: 108 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,108 @@
1+
name: CI
2+
3+
on:
4+
pull_request:
5+
branches: [main]
6+
push:
7+
branches: [main]
8+
9+
concurrency:
10+
group: ${{ github.workflow }}-${{ github.ref }}
11+
cancel-in-progress: true
12+
13+
jobs:
14+
lint:
15+
name: Lint & Format
16+
runs-on: ubuntu-latest
17+
steps:
18+
- uses: actions/checkout@v6
19+
20+
- uses: pnpm/action-setup@v4
21+
with:
22+
version: latest
23+
24+
- uses: actions/setup-node@v6
25+
with:
26+
node-version: "20"
27+
cache: "pnpm"
28+
29+
- name: Install dependencies
30+
run: pnpm install --frozen-lockfile
31+
32+
- name: Biome lint & format check
33+
run: pnpm lint
34+
35+
type-check:
36+
name: Type Check
37+
runs-on: ubuntu-latest
38+
steps:
39+
- uses: actions/checkout@v6
40+
41+
- uses: pnpm/action-setup@v4
42+
with:
43+
version: latest
44+
45+
- uses: actions/setup-node@v6
46+
with:
47+
node-version: "20"
48+
cache: "pnpm"
49+
50+
- name: Install dependencies
51+
run: pnpm install --frozen-lockfile
52+
53+
- name: TypeScript type check
54+
run: npx tsc --noEmit
55+
56+
test-unit:
57+
name: Unit Tests
58+
runs-on: ubuntu-latest
59+
steps:
60+
- uses: actions/checkout@v6
61+
62+
- uses: pnpm/action-setup@v4
63+
with:
64+
version: latest
65+
66+
- uses: actions/setup-node@v6
67+
with:
68+
node-version: "20"
69+
cache: "pnpm"
70+
71+
- name: Install dependencies
72+
run: pnpm install --frozen-lockfile
73+
74+
- name: Run unit tests
75+
run: pnpm test:unit
76+
77+
test-integration:
78+
name: Integration Tests
79+
runs-on: ubuntu-latest
80+
# Requires a Neon-compatible DATABASE_URL secret.
81+
# Add it under GitHub → Settings → Secrets and variables → Actions.
82+
# The app uses @neondatabase/serverless (HTTP-based), so a standard local
83+
# Postgres container is not sufficient — use a real Neon test database.
84+
if: ${{ secrets.DATABASE_URL != '' }}
85+
env:
86+
DATABASE_URL: ${{ secrets.DATABASE_URL }}
87+
# SESSION_SECRET can be any string for test purposes
88+
SESSION_SECRET: ${{ secrets.SESSION_SECRET || 'ci-integration-test-secret' }}
89+
steps:
90+
- uses: actions/checkout@v6
91+
92+
- uses: pnpm/action-setup@v4
93+
with:
94+
version: latest
95+
96+
- uses: actions/setup-node@v6
97+
with:
98+
node-version: "20"
99+
cache: "pnpm"
100+
101+
- name: Install dependencies
102+
run: pnpm install --frozen-lockfile
103+
104+
- name: Apply database migrations
105+
run: pnpm db:migrate
106+
107+
- name: Run integration tests
108+
run: pnpm test:integration

0 commit comments

Comments
 (0)