chore: add ci-local.sh pre-push check mirror #2
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: CI | |
| on: | |
| pull_request: | |
| push: | |
| branches: [main] | |
| workflow_dispatch: | |
| permissions: | |
| contents: read | |
| jobs: | |
| backend: | |
| name: Backend (pytest + lint) | |
| runs-on: ubuntu-latest | |
| defaults: | |
| run: | |
| working-directory: backend | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Install uv | |
| uses: astral-sh/setup-uv@v5 | |
| with: | |
| python-version: "3.11" | |
| - name: Sync deps | |
| run: uv sync | |
| # Hard gate — verified green locally (63 tests, eval smoke runs offline). | |
| - name: Tests | |
| run: uv run pytest -q | |
| # Informational — not blocking yet (no ruff config / baseline complexity). | |
| - name: Lint (ruff) | |
| continue-on-error: true | |
| run: uvx ruff check app | |
| - name: Complexity (radon, C+ only) | |
| continue-on-error: true | |
| run: uvx radon cc -s -n C app | |
| frontend: | |
| name: Frontend (vitest + build) | |
| runs-on: ubuntu-latest | |
| defaults: | |
| run: | |
| working-directory: frontend | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: actions/setup-node@v4 | |
| with: | |
| node-version: "20" | |
| cache: npm | |
| cache-dependency-path: frontend/package-lock.json | |
| - name: Install | |
| run: npm ci | |
| # Hard gates — verified green locally (86 tests, clean build). | |
| - name: Tests | |
| run: npm run test:run | |
| - name: Build | |
| run: npm run build | |
| # Informational — not blocking yet. | |
| - name: Audit | |
| continue-on-error: true | |
| run: npm audit --audit-level=high | |
| # Lighthouse is opt-in: needs a headless browser + preview server and is | |
| # flaky in CI. Run on demand rather than gating every PR. | |
| lighthouse: | |
| name: Lighthouse (manual) | |
| if: github.event_name == 'workflow_dispatch' | |
| runs-on: ubuntu-latest | |
| defaults: | |
| run: | |
| working-directory: frontend | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: actions/setup-node@v4 | |
| with: | |
| node-version: "20" | |
| cache: npm | |
| cache-dependency-path: frontend/package-lock.json | |
| - run: npm ci | |
| - run: npm run build | |
| - name: Lighthouse CI | |
| continue-on-error: true | |
| run: npx lhci autorun --config=lighthouserc.js |