# ci.yml
#
# Fast quality gate on every push to main and every pull request.
# Two checks:
#   1. check-raw-siteconversion — no direct SiteConversion queries
#      that bypass countedConversionWhere (guards against count drift)
#   2. tsc --noEmit — no TypeScript type errors
#
# No deploy steps. Median run time: ~60 seconds.

name: CI

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

jobs:
  quality:
    name: Quality gate
    runs-on: ubuntu-latest

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

      - name: Setup Node
        uses: actions/setup-node@v4
        with:
          node-version: 22
          cache: npm

      - name: Install dependencies
        run: npm ci

      - name: Conversion query guard
        run: node scripts/check-raw-siteconversion.mjs

      - name: TypeScript typecheck
        run: npx tsc --noEmit
