name: CI

on:
  push:
    branches: [ master, dev ]
  pull_request:
    branches: [ master, dev ]

jobs:
  build:

    runs-on: ubuntu-latest
    strategy:
      fail-fast: false # Allows 3.12 to finish even if 3.9 fails
      matrix:
        python-version: ["3.10", "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'
        cache-dependency-path: './pyproject.toml'
    - name: Install dependencies
      run: |
        python -m pip install --upgrade pip
        pip install .[dev,test]
    - name: Lint with ruff
      run: |
        # stop the build if there are Python syntax errors or undefined names
        ruff check . --output-format=github
    - name: Test with pytest
      run: |
        pytest -v
