name: CI

on: [push, pull_request, workflow_dispatch]

permissions:
  contents: read

jobs:
  main:
    name: Python ${{ matrix.python }}
    runs-on: ubuntu-20.04
    strategy:
      fail-fast: false
      matrix:
        python: ["3.7", "3.8", "3.9", "3.10", "3.11", "3.12", "3.13", "pypy3.9", "pypy3.10"]
    steps:
      - uses: actions/checkout@d632683dd7b4114ad314bca15554477dd762a938 # v4.2.0
      - uses: actions/setup-python@f677139bbe7f9c59b41e40162b753c062f5d49a3 # v5.2.0
        with:
          python-version: ${{ matrix.python }}
          allow-prereleases: true
      - run: python -m pip install coverage tox
      - run: python -m tox
      - uses: codecov/codecov-action@e28ff129e5465c2c0dcc6f003fc735cb6ae0c673 # v4.5.0
        with:
          name: ${{ matrix.python }}
          token: ${{ secrets.CODECOV_TOKEN }}
