name: CI

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

jobs:
  test:
    name: Test (Python ${{ matrix.python-version }})
    runs-on: ubuntu-latest
    strategy:
      fail-fast: false
      matrix:
        python-version: ["3.10", "3.11", "3.12"]

    steps:
      - uses: actions/checkout@v4

      - uses: actions/setup-python@v5
        with:
          python-version: ${{ matrix.python-version }}

      - name: Install SDK + server deps
        run: |
          pip install --upgrade pip
          pip install -e .
          pip install \
            fastapi \
            "uvicorn[standard]" \
            "sqlalchemy[asyncio]" \
            aiosqlite \
            alembic \
            aiofiles \
            bcrypt \
            httpx \
            pytest \
            pytest-asyncio \
            ruff

      - name: Lint
        run: ruff check .

      - name: Test
        run: pytest -q
