name: Test

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

jobs:
  tests:
    runs-on: ubuntu-latest
    env:
      FORCE_COLOR: "1"
    strategy:
      fail-fast: false
      matrix:
        os: [ ubuntu-latest, windows-latest, macos-latest ]
        python-version: [ "3.9", "3.10", "3.11", "3.12", "3.13" ]
    steps:
      - uses: actions/checkout@v4
        with:
          fetch-depth: 0
      - uses: actions/setup-python@v5
        with:
          python-version: ${{ matrix.python-version }}
          allow-prereleases: true
          cache: pip
      - run: python -Im pip install tox
      - run: |
          python -Im tox run \
            -f py$(echo ${{ matrix.python-version }} | tr -d .)
