name: Python CI

on:
  push:
    branches: [main]
    paths-ignore:
      - '**.md'
      - 'doc/**'
  pull_request:
    branches: [main]
    paths-ignore:
      - '**.md'
      - 'doc/**'

env:
  CARGO_TERM_COLOR: always
  MACOSX_DEPLOYMENT_TARGET: "13.0"

jobs:
  test:
    name: Python bindings (${{ matrix.os }})
    runs-on: ${{ matrix.os }}
    strategy:
      fail-fast: false
      matrix:
        os: [ubuntu-latest, macos-latest, windows-latest]

    steps:
      - uses: actions/checkout@v5
        with:
          persist-credentials: false

      - name: Install Rust
        uses: dtolnay/rust-toolchain@stable

      - name: Setup uv
        uses: astral-sh/setup-uv@v5
        with:
          version: "0.11.14"
          enable-cache: true

      - name: Build and test Python bindings
        working-directory: packages/fff-python
        shell: bash
        run: |
          uv sync --all-extras
          uv run maturin develop --release
          uv run pytest -v
