echos-ocr/.github/workflows/ci.yml
Randall Stillwell 9c1aaaa61f Bootstrap agent-context pipeline (L1 + L2 + L3)
Installs a 3-layer Cursor-aligned agent pipeline so future agent
sessions can orient quickly and stay inside guard rails:

L1 — context for any agent reading the repo:
  - AGENTS.md (top-level orientation, conventions, no-go zones)
  - .cursor/rules/ (no-go-zones, api-routes, prisma, prisma-schema-map)
  - .cursor/skills/ (add-api-route, add-prisma-model)
  - docs/SCHEMA_MAP.md generated from prisma/schema.prisma
  - scripts/generate-schema-map.ts (regenerate the map; wired up as
    `npm run schema:map`)

L2 — subagent roles for the 9-stage idea-to-feature pipeline:
  - .cursor/agents/role-*.md (conductor, architect, ia-architect,
    design-system-auditor, implementer, reviewer, ux-reviewer,
    a11y-auditor, doc-writer) with explicit multitask annotations.

L3 — pipeline scaffolding:
  - .github/CODEOWNERS, PR template, and CI workflows (ci.yml,
    preview-smoke.yml, visual-diff.yml, pr-health-rollup.yml).
    Test job is intentionally disabled until Playwright is wired up.
  - .convoys/ folder for per-feature run notes + scripts/log-convoy-event.sh.
  - scripts/wt.sh worktree helper.
  - src/lib/flags/index.ts simple env-driven feature flag wrapper.
  - tests/smoke/app.smoke.spec.ts (Playwright smoke; excluded from
    tsc until @playwright/test is installed — see tsconfig change).

Also writes .agent-context-manifest.yml so the sync-agent-context
skill can detect drift and offer selective updates from upstream.

Follow-ups (not in this commit):
  - Install @playwright/test and re-enable the test job in ci.yml.
  - Review .cursor/agents/role-*.md and trim any roles that don't
    apply to this codebase.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-05-23 14:55:18 -05:00

98 lines
2.9 KiB
YAML

name: CI
on:
pull_request:
branches: [main]
push:
branches: [main]
concurrency:
group: ci-${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
env:
NODE_VERSION: '20'
jobs:
lint-types-build:
name: Lint, types, build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: ${{ env.NODE_VERSION }}
cache: npm
- run: npm ci
- name: Generate Prisma client
run: npx prisma generate
- run: npm run lint
- name: Type check
run: npx tsc --noEmit
- name: Build
run: npm run build
env:
# Build-time env. Real values come from Cloud Run / Vercel — set non-empty defaults
# here so the build doesn't crash on missing required vars.
DATABASE_URL: postgresql://ci:ci@localhost:5432/ci
NEXTAUTH_SECRET: ci-secret-only-for-build
NEXTAUTH_URL: http://localhost:3000
# NOTE: echos-ocr has no test runner configured yet (no vitest / jest /
# playwright in package.json). Re-enable this job once a test runner is
# adopted and a `test:run` script exists in package.json. Until then,
# this block stays commented so CI doesn't fail on a missing script.
#
# test:
# name: Unit + integration tests
# runs-on: ubuntu-latest
# services:
# postgres:
# image: postgres:16
# env:
# POSTGRES_USER: ci
# POSTGRES_PASSWORD: ci
# POSTGRES_DB: ci
# ports: ['5432:5432']
# options: >-
# --health-cmd "pg_isready -U ci"
# --health-interval 5s
# --health-timeout 5s
# --health-retries 10
# steps:
# - uses: actions/checkout@v4
# - uses: actions/setup-node@v4
# with:
# node-version: ${{ env.NODE_VERSION }}
# cache: npm
# - run: npm ci
# - run: npx prisma generate
# - name: Run migrations
# run: npx prisma migrate deploy
# env:
# DATABASE_URL: postgresql://ci:ci@localhost:5432/ci
# - run: npm run test:run
# env:
# DATABASE_URL: postgresql://ci:ci@localhost:5432/ci
# NEXTAUTH_SECRET: ci-secret-only-for-tests
# NEXTAUTH_URL: http://localhost:3000
schema-map-fresh:
name: Schema map up to date
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: ${{ env.NODE_VERSION }}
cache: npm
- run: npm ci
- name: Regenerate schema map
run: npm run schema:map
- name: Verify no drift
run: |
if ! git diff --quiet docs/SCHEMA_MAP.md; then
echo "::error::docs/SCHEMA_MAP.md is out of date. Run 'npm run schema:map' and commit."
git diff docs/SCHEMA_MAP.md
exit 1
fi