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

jobs:
  test:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4
      - uses: actions/setup-python@v5
        with:
          python-version: "3.11"
      - name: Install backend deps
        run: pip install -e ".[dev]"
      - name: Version consistency
        run: python scripts/sync_version.py --check
      - name: Lint
        run: ruff check backend/
      - name: Tests
        run: python -m pytest -q
      - uses: actions/setup-node@v4
        with:
          node-version: "20"
      - name: Frontend type check
        run: |
          cd frontend/web
          npm ci
          npx tsc --noEmit
