name: CI

on:
  push:
    branches: [main]
  pull_request:

jobs:
  test:
    runs-on: ubuntu-latest

    steps:
      - uses: actions/checkout@v5
      - uses: actions/setup-python@v6
        with:
          python-version: "{{ python_version }}"
      - name: Install dependencies
        run: |
          python -m pip install --upgrade pip
          pip install -e .{% if include_ruff or include_mypy or include_pytest %}[dev]{% endif %}
      - name: Run checks
        run: |
          {% if include_ruff -%}
          ruff check .
          ruff format --check .
          {% endif -%}
          {% if include_mypy -%}
          mypy .
          {% endif -%}
          {% if include_pytest -%}
          pytest
          {% endif -%}
