Skip to content
Merged
Show file tree
Hide file tree
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
33 changes: 33 additions & 0 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
name: Tests

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

jobs:
test:
name: Unit Tests
runs-on: ubuntu-latest

steps:
- name: Checkout
uses: actions/checkout@v6

- name: Setup pnpm
uses: pnpm/action-setup@v6
with:
version: latest

- name: Setup Node.js
uses: actions/setup-node@v6
with:
node-version: 26
cache: pnpm

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

- name: Run tests
run: pnpm test
30 changes: 17 additions & 13 deletions docs/development.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,19 +27,23 @@ Open `http://localhost:3000` and log in with the credentials from `SEED_ADMIN_*`

## Commands

| Command | Description |
| ------------------- | ---------------------------------------------------------------- |
| `pnpm dev` | Start the dev server with hot reload |
| `pnpm build` | Production build |
| `pnpm start` | Start the production server (requires a prior build) |
| `pnpm lint` | Run ESLint |
| `pnpm format` | Auto-format all files with Prettier |
| `pnpm format:check` | Check formatting without writing (used in CI) |
| `pnpm db:generate` | Generate migrations from schema changes |
| `pnpm db:migrate` | Apply all pending migrations |
| `pnpm db:seed` | Seed the 6 teams + admin user (idempotent) |
| `pnpm db:reset` | Drop and recreate the local database (**blocked in production**) |
| `pnpm db:studio` | Open Drizzle Studio - visual database browser (dev only) |
| Command | Description |
| -------------------- | ---------------------------------------------------------------- |
| `pnpm dev` | Start the dev server with hot reload |
| `pnpm build` | Production build |
| `pnpm start` | Start the production server (requires a prior build) |
| `pnpm lint` | Run ESLint |
| `pnpm format` | Auto-format all files with Prettier |
| `pnpm format:check` | Check formatting without writing (used in CI) |
| `pnpm db:generate` | Generate migrations from schema changes |
| `pnpm db:migrate` | Apply all pending migrations |
| `pnpm db:seed` | Seed the 6 teams + admin user (idempotent) |
| `pnpm db:reset` | Drop and recreate the local database (**blocked in production**) |
| `pnpm db:studio` | Open Drizzle Studio - visual database browser (dev only) |
| `pnpm test` | Run the unit test suite once |
| `pnpm test:watch` | Re-run tests on save (use while developing) |
| `pnpm test:ui` | Open the Vitest browser UI |
| `pnpm test:coverage` | Generate a coverage report |

## Environment Variables

Expand Down
10 changes: 9 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,10 @@
"format:check": "prettier --check .",
"typecheck": "tsc --noEmit",
"check": "pnpm lint && pnpm format:check && pnpm typecheck",
"test": "vitest run",
"test:watch": "vitest",
"test:ui": "vitest --ui",
"test:coverage": "vitest run --coverage",
"db:generate": "drizzle-kit generate",
"db:migrate": "drizzle-kit migrate",
"db:seed": "tsx scripts/seed.ts",
Expand Down Expand Up @@ -63,6 +67,8 @@
"@types/node": "^25",
"@types/react": "^19",
"@types/react-dom": "^19",
"@vitest/coverage-v8": "^4.1.9",
"@vitest/ui": "^4.1.9",
"drizzle-kit": "^0.31.10",
"eslint": "^9",
"eslint-config-next": "16.2.9",
Expand All @@ -74,6 +80,8 @@
"shadcn": "^4.11.0",
"tailwindcss": "^4",
"tsx": "^4.22.4",
"typescript": "^6"
"typescript": "^6",
"vite-tsconfig-paths": "^6.1.1",
"vitest": "^4.1.9"
}
}
Loading