Add CI pipeline with lint, typecheck, and unit tests
Creates Gitea Actions workflow that runs on pull requests and pushes to main. Enforces quality gates (lint, typecheck, unit tests) in CI, complementing the local Lefthook pre-commit hooks. Features: - Node.js 24 with pnpm 10 setup - pnpm dependency caching for faster runs - Linting with biome - TypeScript type checking - 950 unit tests via vitest Completes P5.3 from the implementation plan. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
58
.gitea/workflows/ci.yml
Normal file
58
.gitea/workflows/ci.yml
Normal file
@@ -0,0 +1,58 @@
|
||||
# ABOUTME: Gitea Actions workflow for CI quality gates on pull requests.
|
||||
# ABOUTME: Runs lint, typecheck, and unit tests before merge is allowed.
|
||||
|
||||
name: CI
|
||||
|
||||
on:
|
||||
pull_request:
|
||||
branches: [main]
|
||||
push:
|
||||
branches: [main]
|
||||
|
||||
jobs:
|
||||
quality:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout code
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Setup Node.js
|
||||
uses: actions/setup-node@v4
|
||||
with:
|
||||
node-version: '24'
|
||||
|
||||
- name: Setup pnpm
|
||||
uses: pnpm/action-setup@v4
|
||||
with:
|
||||
version: 10
|
||||
|
||||
- name: Get pnpm store directory
|
||||
shell: bash
|
||||
run: |
|
||||
echo "STORE_PATH=$(pnpm store path --silent)" >> $GITHUB_ENV
|
||||
|
||||
- name: Setup pnpm cache
|
||||
uses: actions/cache@v4
|
||||
with:
|
||||
path: ${{ env.STORE_PATH }}
|
||||
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
|
||||
restore-keys: |
|
||||
${{ runner.os }}-pnpm-store-
|
||||
|
||||
- name: Install dependencies
|
||||
run: pnpm install --frozen-lockfile
|
||||
|
||||
- name: Run linter
|
||||
run: pnpm lint
|
||||
|
||||
- name: Run typecheck
|
||||
run: pnpm tsc --noEmit
|
||||
|
||||
- name: Run unit tests
|
||||
run: pnpm test:run
|
||||
env:
|
||||
# Required env vars for tests (dummy values for CI)
|
||||
NEXT_PUBLIC_POCKETBASE_URL: http://localhost:8090
|
||||
RESEND_API_KEY: re_test_key
|
||||
ENCRYPTION_KEY: 12345678901234567890123456789012
|
||||
CRON_SECRET: test_cron_secret
|
||||
Reference in New Issue
Block a user