name: "main"

on: ["push", "workflow_dispatch"]

jobs:
  # * ------------------------------------------------------------------------------ * #
  # * Changes below may be lost in significant template updates.

  pyright:
    runs-on: "{{ actions_runner }}"
    steps:
      - uses: "blakeNaccarato/copier-python-workflow-setup@v0.1.0"
        with:
          python-version: "{{ python_version }}"
      - run: ".tools/scripts/Invoke-Pyright.ps1"
        shell: "pwsh"
  ruff:
    runs-on: "{{ actions_runner }}"
    steps:
      - uses: "blakeNaccarato/copier-python-workflow-setup@v0.1.0"
        with:
          python-version: "{{ python_version }}"
      - run: "ruff --no-fix --format github ."
  pytest:
    runs-on: "{{ actions_runner }}"
    steps:
      - uses: "blakeNaccarato/copier-python-workflow-setup@v0.1.0"
        with:
          python-version: "{{ python_version }}"
      - run: "pytest --cov"
      - uses: "codecov/codecov-action@v3.1.4"
  bump_project:
    needs: ["pyright", "ruff", "pytest"]
    runs-on: "{{ actions_runner }}"
    steps:
      - uses: "blakeNaccarato/copier-python-workflow-setup@v0.1.0"
        with:
          python-version: "{{ python_version }}"
          install-project: false
      - uses: "stefanzweifel/git-auto-commit-action@v4.16.0"
        with:
          commit_message: "Bump project template and compose `pyproject.toml`."

  # * ------------------------------------------------------------------------------ * #
  # * Changes below should persist in significant template updates.
