---
name: Python package

"on": [push, pull_request]

jobs:
  build:

    runs-on: ${{ matrix.os }}
    strategy:
      matrix:
        os: [ubuntu-latest, macos-latest, windows-latest]
        python-version: ['3.10', '3.11', '3.12', '3.13', '3.14']
      fail-fast: false

    steps:
      - uses: actions/checkout@v6
      - name: Set up Python ${{ matrix.python-version }}
        uses: actions/setup-python@v6
        with:
          python-version: ${{ matrix.python-version }}
      - name: Install dependencies
        run: |
          python -m pip install --upgrade pip cython
          pip install -U pip ".[dev]"
      - name: Style checks
        run: |
          python -m ruff check .
          python -m ruff format --check .
      - name: Test suite run (pure Python)
        run: |
          python -m unittest tests.test_suite
        env:
          PYTHONHASHSEED: random
      - name: Run cargo fmt
        run: |
          cargo fmt --all -- --check
      - name: Install in editable mode
        run: |
          pip install -e .
      - name: Test suite run (with Rust extension)
        run: |
          python -m unittest tests.test_suite
        env:
          PYTHONHASHSEED: random
