name: Tests

on:
  push:
    branches: [ "main" ]
  pull_request:
    branches: [ "main" ]
  workflow_dispatch:
    # Allows manual triggering from the GitHub Actions UI

jobs:
  build:
    name: Test with pytest
    runs-on: ubuntu-latest
    strategy:
      matrix:
        python-version:
          - "3.12"
          - "3.13"
    steps:
      - uses: actions/checkout@v4

      - name: Install uv
        uses: astral-sh/setup-uv@v5
        with:
          python-version: ${{ matrix.python-version }}
          enable-cache: true
          cache-dependency-glob: "uv.lock"

      - name: Install the project
        run: uv sync --locked --all-extras --dev

      - name: Run tests
        run: uv run pytest
