Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
108 changes: 108 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,108 @@
name: CI

on:
pull_request:
branches: [main]
push:
branches: [main]

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:
lint:
name: Lint & Format
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6

- uses: pnpm/action-setup@v4
with:
version: latest

- uses: actions/setup-node@v6
with:
node-version: "20"
cache: "pnpm"

- name: Install dependencies
run: pnpm install --frozen-lockfile

- name: Biome lint & format check
run: pnpm lint

type-check:
name: Type Check
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6

- uses: pnpm/action-setup@v4
with:
version: latest

- uses: actions/setup-node@v6
with:
node-version: "20"
cache: "pnpm"

- name: Install dependencies
run: pnpm install --frozen-lockfile

- name: TypeScript type check
run: npx tsc --noEmit

test-unit:
name: Unit Tests
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6

- uses: pnpm/action-setup@v4
with:
version: latest

- uses: actions/setup-node@v6
with:
node-version: "20"
cache: "pnpm"

- name: Install dependencies
run: pnpm install --frozen-lockfile

- name: Run unit tests
run: pnpm test:unit

test-integration:
name: Integration Tests
runs-on: ubuntu-latest
# Requires a Neon-compatible DATABASE_URL secret.
# Add it under GitHub → Settings → Secrets and variables → Actions.
# The app uses @neondatabase/serverless (HTTP-based), so a standard local
# Postgres container is not sufficient — use a real Neon test database.
if: ${{ secrets.DATABASE_URL != '' }}
env:
DATABASE_URL: ${{ secrets.DATABASE_URL }}
# SESSION_SECRET can be any string for test purposes
SESSION_SECRET: ${{ secrets.SESSION_SECRET || 'ci-integration-test-secret' }}
steps:
- uses: actions/checkout@v6

- uses: pnpm/action-setup@v4
with:
version: latest

- uses: actions/setup-node@v6
with:
node-version: "20"
cache: "pnpm"

- name: Install dependencies
run: pnpm install --frozen-lockfile

- name: Apply database migrations
run: pnpm db:migrate

- name: Run integration tests
run: pnpm test:integration