name: Tests

on:
  pull_request:
  push:
    branches:
      - main
  workflow_dispatch:

jobs:
  unittest:
    name: unittest (${{ matrix.python-version }})
    runs-on: ubuntu-latest
    strategy:
      fail-fast: false
      matrix:
        python-version: ["3.11", "3.12"]

    steps:
      - name: Checkout
        uses: actions/checkout@v4

      - name: Set up Python
        uses: actions/setup-python@v5
        with:
          python-version: ${{ matrix.python-version }}

      - name: Install dependencies
        run: |
          python -m pip install --upgrade pip
          pip install -r requirements.txt
          pip install -e .

      - name: Run unit tests
        run: python -m unittest discover -s tests -p "test_*.py" -v