veza/.github/workflows/frontend-ci.yml
senke 4ee8c38536
Some checks failed
Veza CI / Backend (Go) (push) Failing after 0s
Veza CI / Frontend (Web) (push) Failing after 0s
Veza CI / Rust (Stream Server) (push) Failing after 0s
Frontend CI / test (push) Failing after 0s
Security Scan / Secret Scanning (gitleaks) (push) Failing after 0s
Veza CI / Notify on failure (push) Failing after 0s
feat(ci): enforce OpenAPI type sync — drift prevention (v1.0.8 P0)
Phase 0 of the OpenAPI typegen migration. Locks in the existing
check-types-sync.sh (which was committed but never wired) so we stop
accumulating drift between veza-backend-api/openapi.yaml and
apps/web/src/types/generated/ before we migrate to orval (Phase 1).

Three enforcement points:

1. Pre-commit hook (.husky/pre-commit)
   Replaces the naked generate-types.sh call with check-types-sync.sh,
   which regenerates and fails if the working tree differs. Skippable
   via SKIP_TYPES=1 (already documented in CLAUDE.md) for emergency
   commits and for environments without node_modules.

2. CI gate (.github/workflows/frontend-ci.yml)
   New "Check OpenAPI types in sync" step before lint/build. Catches
   PRs that touched openapi.yaml without regenerating types.
   Expanded the paths trigger to include veza-backend-api/openapi.yaml
   and docs/swagger.yaml so spec-only edits still run the check.

3. Makefile target (make openapi-check)
   Local convenience — same check as CI/hook, callable without staging
   anything. Pairs with existing `make openapi` (regenerate spec from
   swaggo annotations).

No spec or type file changes in this commit — pure plumbing.

Refs:
- AUDIT_REPORT.md §9 item #8 (OpenAPI typegen, deferred v1.0.8)
- Memory: project_next_priority_openapi_client.md
- /home/senke/.claude/plans/audit-fonctionnel-wild-hickey.md Item 2 Phase 0

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-04-23 20:33:13 +02:00

64 lines
1.8 KiB
YAML

name: Frontend CI
on:
push:
paths:
- "apps/web/**"
- "veza-backend-api/openapi.yaml"
- "veza-backend-api/docs/swagger.yaml"
- ".github/workflows/frontend-ci.yml"
pull_request:
paths:
- "apps/web/**"
- "veza-backend-api/openapi.yaml"
- "veza-backend-api/docs/swagger.yaml"
- ".github/workflows/frontend-ci.yml"
env:
GIT_SSL_NO_VERIFY: "true"
NODE_TLS_REJECT_UNAUTHORIZED: "0"
jobs:
test:
runs-on: ubuntu-latest
defaults:
run:
working-directory: apps/web
steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
- name: Set up Node
uses: actions/setup-node@1d0ff469b7ec7b3cb9d8673fde0c81c44821de2a # v4.2.0
with:
node-version: "20"
cache: "npm"
cache-dependency-path: apps/web/package-lock.json
- name: Install dependencies
run: npm ci
# v1.0.8 OpenAPI Phase 0 — prevents drift between
# veza-backend-api/openapi.yaml and apps/web/src/types/generated/.
# check-types-sync.sh regenerates then fails if git diff is non-empty.
- name: Check OpenAPI types in sync
run: bash scripts/check-types-sync.sh
- name: Lint
run: npm run lint
- name: TypeScript check
run: npx tsc --noEmit
- name: Build
run: npm run build
- name: Bundle size gate
run: node scripts/check-bundle-size.mjs
- name: Audit dependencies
run: npm audit --audit-level=critical
- name: Run tests
run: npm run test -- --run