name: CI # Run checks on pull requests to verify code quality before merge. # Jobs run in parallel for fast feedback. Any failing check blocks the PR. on: pull_request: types: [opened, synchronize, reopened] workflow_call: jobs: # Lint job: Check code quality with oxlint lint: name: Lint runs-on: ubuntu-latest steps: - name: Checkout code uses: actions/checkout@v4 - name: Setup pnpm uses: pnpm/action-setup@v4 with: version: 9.15.4 - name: Setup Node.js uses: actions/setup-node@v4 with: node-version: '22' cache: 'pnpm' - name: Install dependencies run: pnpm install --frozen-lockfile - name: Run oxlint run: pnpm exec oxlint . # Typecheck job: Verify TypeScript types typecheck: name: Type Check runs-on: ubuntu-latest steps: - name: Checkout code uses: actions/checkout@v4 - name: Setup pnpm uses: pnpm/action-setup@v4 with: version: 9.15.4 - name: Setup Node.js uses: actions/setup-node@v4 with: node-version: '22' cache: 'pnpm' - name: Install dependencies run: pnpm install --frozen-lockfile - name: Run type check run: pnpm turbo lint # Test job: Run unit and integration tests # Requires PostgreSQL service for database tests test: name: Test runs-on: ubuntu-latest services: postgres: image: postgres:17 env: POSTGRES_USER: atbb POSTGRES_PASSWORD: atbb POSTGRES_DB: atbb options: >- --health-cmd pg_isready --health-interval 10s --health-timeout 5s --health-retries 5 ports: - 5432:5432 steps: - name: Checkout code uses: actions/checkout@v4 - name: Setup pnpm uses: pnpm/action-setup@v4 with: version: 9.15.4 - name: Setup Node.js uses: actions/setup-node@v4 with: node-version: '22' cache: 'pnpm' - name: Install dependencies run: pnpm install --frozen-lockfile - name: Build packages run: pnpm build - name: Run database migrations run: pnpm --filter @atbb/appview db:migrate env: DATABASE_URL: postgresql://atbb:atbb@localhost:5432/atbb - name: Run tests run: pnpm test env: DATABASE_URL: postgresql://atbb:atbb@localhost:5432/atbb # Build job: Verify TypeScript compilation succeeds # Runs in parallel with other checks to catch build errors early build: name: Build runs-on: ubuntu-latest steps: - name: Checkout code uses: actions/checkout@v4 - name: Setup pnpm uses: pnpm/action-setup@v4 with: version: 9.15.4 - name: Setup Node.js uses: actions/setup-node@v4 with: node-version: '22' cache: 'pnpm' - name: Install dependencies run: pnpm install --frozen-lockfile - name: Build all packages run: pnpm build