name: CI

on:
  pull_request:
  push:
    branches: [main]

permissions:
  contents: read

jobs:
  test:
    runs-on: ubuntu-latest

    strategy:
      fail-fast: false
      matrix:
        python-version: ["3.11", "3.12"]

    steps:
      - name: Checkout
        uses: actions/checkout@v4

      - name: Install uv
        uses: astral-sh/setup-uv@v3
        with:
          python-version: ${{ matrix.python-version }}
          enable-cache: true

      - name: Sync dependencies
        run: uv sync --all-extras --dev

      - name: Lint (ruff)
        run: uv run ruff check .

      - name: Format check (black)
        run: uv run black --check .
