name: CI

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

jobs:
  lint:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4
      - uses: astral-sh/setup-uv@v5
        with:
          version: 'latest'
      - name: Install ruff
        run: uv tool install ruff
      - name: Lint
        run: ruff check .

  test:
    runs-on: ubuntu-latest
    strategy:
      matrix:
        python-version: ['3.10', '3.11', '3.12', '3.13']
    steps:
      - uses: actions/checkout@v4
      - uses: astral-sh/setup-uv@v5
        with:
          version: 'latest'
      - name: Set up Python ${{ matrix.python-version }}
        run: uv venv --python ${{ matrix.python-version }}
      - name: Install dependencies
        run: uv pip install -e . pytest
      - name: Run tests
        run: uv run pytest tests/ -v
