name: Verify

on:
  pull_request:
  push:
    branches: [main]

jobs:
  verify:
    runs-on: ubuntu-latest
    steps:
      - name: Checkout
        uses: actions/checkout@v4
      - name: Set up Python
        uses: actions/setup-python@v5
        with:
          python-version: '3.11'
      - name: Install API gateway
        run: python -m pip install -e "apps/api-gateway[dev]"
      - name: Set up Node.js
        uses: actions/setup-node@v4
        with:
          node-version: 20
          cache: npm
          cache-dependency-path: apps/dashboard/package-lock.json
      - name: Install dashboard dependencies
        working-directory: apps/dashboard
        run: npm ci
      - name: Run repository verification
        run: make verify
      - name: Run gateway tests
        run: make test-gateway
      - name: Check OpenAPI export
        run: make openapi-check
