feat: add backend test suite (157 tests) and GitHub Actions CI #1
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: | |
| push: | |
| branches: [main] | |
| pull_request: | |
| branches: [main] | |
| concurrency: | |
| group: ci-${{ github.ref }} | |
| cancel-in-progress: true | |
| jobs: | |
| # ── Backend: lint + format ───────────────────────────────────────────── | |
| backend-lint: | |
| name: "Backend · Lint & Format" | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: astral-sh/setup-uv@v6 | |
| with: | |
| enable-cache: true | |
| - run: uv sync --frozen --dev | |
| - run: uv run ruff check core/ api/ db/ tests/ | |
| - run: uv run ruff format --check core/ api/ db/ tests/ | |
| # ── Backend: tests ───────────────────────────────────────────────────── | |
| backend-test: | |
| name: "Backend · Tests" | |
| runs-on: ubuntu-latest | |
| needs: backend-lint | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: astral-sh/setup-uv@v6 | |
| with: | |
| enable-cache: true | |
| - run: uv sync --frozen --dev | |
| - run: uv run pytest tests/ -v --tb=short | |
| # ── Frontend: lint + typecheck ───────────────────────────────────────── | |
| frontend-lint: | |
| name: "Frontend · Lint & Typecheck" | |
| runs-on: ubuntu-latest | |
| defaults: | |
| run: | |
| working-directory: frontend | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: actions/setup-node@v4 | |
| with: | |
| node-version: 22 | |
| cache: npm | |
| cache-dependency-path: frontend/package-lock.json | |
| - run: npm ci | |
| - run: npm run lint | |
| - run: npm run typecheck | |
| # ── Docker builds (parallel) ─────────────────────────────────────────── | |
| docker-backend: | |
| name: "Docker · Backend" | |
| runs-on: ubuntu-latest | |
| needs: backend-test | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - run: docker build -t data-agent-backend:ci . | |
| docker-sandbox: | |
| name: "Docker · Sandbox" | |
| runs-on: ubuntu-latest | |
| needs: backend-test | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - run: docker build -t data-agent-sandbox:ci sandbox/ | |
| docker-frontend: | |
| name: "Docker · Frontend" | |
| runs-on: ubuntu-latest | |
| needs: frontend-lint | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - run: > | |
| docker build | |
| --build-arg REWRITE_API_ORIGIN=http://backend:8000 | |
| -t data-agent-frontend:ci | |
| frontend/ |