update readme.md for peer reviewers #118
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 Pipeline | |
| on: | |
| workflow_dispatch: | |
| push: | |
| branches: [main, dev] | |
| pull_request: | |
| jobs: | |
| # ---------------------------- | |
| # 1. Linting & Type Checks | |
| # ---------------------------- | |
| lint-and-typecheck: | |
| name: Run pre-commit (Ruff, mypy, format checks) | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v4 | |
| - name: Set up Python | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: "3.11" | |
| - name: Install uv | |
| uses: astral-sh/setup-uv@v3 | |
| - name: Install backend deps | |
| working-directory: backend | |
| run: uv sync | |
| # If your mypy hook needs src on sys.path, expose it here too | |
| - name: Run pre-commit hooks | |
| env: | |
| PYTHONPATH: backend/src | |
| run: | | |
| pip install pre-commit | |
| pre-commit run --all-files | |
| # ---------------------------- | |
| # 2. Backend Tests (Python + PostGIS) | |
| # ---------------------------- | |
| backend-tests: | |
| name: Backend Tests | |
| runs-on: ubuntu-latest | |
| needs: lint-and-typecheck | |
| services: | |
| postgres: | |
| image: postgis/postgis:16-3.4 | |
| env: | |
| POSTGRES_DB: seatcheck | |
| POSTGRES_USER: seatcheck | |
| POSTGRES_PASSWORD: seatcheck | |
| ports: | |
| - 5432:5432 | |
| options: >- | |
| --health-cmd="pg_isready -U seatcheck -d seatcheck" | |
| --health-interval=10s | |
| --health-timeout=5s | |
| --health-retries=10 | |
| env: | |
| DATABASE_URL: postgresql+psycopg2://seatcheck:seatcheck@localhost:5432/seatcheck | |
| DEV_AUTH: "1" | |
| APP_BASE: "http://localhost:8081" | |
| PYTHONPATH: backend/src | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| - name: Set up Python | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: "3.12" | |
| - name: Install uv | |
| uses: astral-sh/setup-uv@v3 | |
| - name: Install backend deps | |
| working-directory: backend | |
| run: uv sync | |
| - name: Wait for PostgreSQL to be ready | |
| run: | | |
| for i in {1..30}; do | |
| if pg_isready -h localhost -U seatcheck -d seatcheck 2>/dev/null; then | |
| echo "PostgreSQL is ready" | |
| exit 0 | |
| fi | |
| echo "Waiting for PostgreSQL... ($i/30)" | |
| sleep 1 | |
| done | |
| echo "PostgreSQL did not become ready in time" | |
| exit 1 | |
| - name: Run Alembic migrations | |
| working-directory: backend | |
| run: uv run alembic upgrade head | |
| - name: Seed database | |
| working-directory: backend | |
| run: uv run python scripts/seed_db.py | |
| - name: Run backend tests with coverage | |
| working-directory: backend | |
| run: uv run pytest --cov=app --cov-report=xml --cov-report=term-missing | |
| # ---------------------------- | |
| # 3. Frontend Tests (Node.js) | |
| # ---------------------------- | |
| frontend-tests: | |
| name: Frontend Tests | |
| runs-on: ubuntu-latest | |
| needs: lint-and-typecheck | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v4 | |
| - name: Set up Node.js | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: "20" | |
| cache: "npm" | |
| cache-dependency-path: seat-check/package-lock.json | |
| - name: Install dependencies | |
| working-directory: seat-check | |
| run: yarn install --frozen-lockfile | |
| - name: Run frontend tests | |
| working-directory: seat-check | |
| env: | |
| # So frontend code builds/tests against the same base as dev | |
| EXPO_PUBLIC_API_BASE: "http://localhost:8000" | |
| run: npm test -- --run |