name: Tests

on:
  push:
    branches: ["master"]
  pull_request:
  # Run once a day.
  schedule:
    - cron: "0 8 * * *"

concurrency:
  group: 'tests-${{ github.head_ref || github.run_id }}'
  cancel-in-progress: true

jobs:
  build:

    runs-on: ubuntu-latest
    strategy:
      matrix:
        python-version: ["3.9", "3.10", "3.11", "3.12", "3.13"]

    steps:
      - uses: actions/checkout@v4
      - name: Set up Python ${{ matrix.python-version }}
        uses: actions/setup-python@v5
        with:
          python-version: ${{ matrix.python-version }}
          cache: 'pip' # caching pip dependencies
      - name: Install dependencies
        run: |
          pip install -e . --group test
      - name: Test with pytest
        run: |
          pytest
