name: Shared Tests

on:
  workflow_call:

jobs:
  test:
    name: Test on ${{ matrix.python-version }}
    runs-on: ubuntu-latest
    strategy:
      fail-fast: true
      matrix:
        python-version: ["3.10", "3.11", "3.12", "3.13"]
    steps:
      - uses: actions/checkout@v4

      - name: Install uv
        uses: astral-sh/setup-uv@v5

      - name: Set up Python
        run: uv python install ${{ matrix.python-version }}

      - name: Install dependencies
        # This creates the environment and installs dev tools (pytest/ruff)
        run: uv sync --all-extras --dev

      - name: Run tests
        run: uv run pytest
