Skip to content

Fix typos flagged by Copilot review on #274 #668

Fix typos flagged by Copilot review on #274

Fix typos flagged by Copilot review on #274 #668

Workflow file for this run

# Regular tests
#
# Use this to ensure your tests are passing on every push and PR.
#
# You should make sure you run jobs on at least the *oldest* and the *newest*
# versions of python that your codebase is intended to support.
name: tests
on:
push:
branches:
- main
pull_request:
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: ${{ github.event_name == 'pull_request' }}
jobs:
# Lint and docs don't depend on OS or python version; run them once.
lint:
timeout-minutes: 15
runs-on: ubuntu-latest
steps:
- name: Check out repository
uses: actions/checkout@v5
- name: Install uv
uses: astral-sh/setup-uv@v6
with:
python-version: "3.13"
enable-cache: true
- name: Install library
run: uv sync --locked
- name: Cache pre-commit
uses: actions/cache@v4
with:
path: ~/.cache/pre-commit/
key: pre-commit-${{ runner.os }}-${{ hashFiles('.pre-commit-config.yaml') }}
# Lightweight hooks run on pre-commit.ci (with PR autofix); only the
# hooks that need the project's .venv run here.
- name: Pre-commit run (env-dependent hooks)
run: |
uv run pre-commit run --all-files --show-diff-on-failure --color=always creosote
uv run pre-commit run --all-files --show-diff-on-failure --color=always pyright
#----------------------------------------------
# make sure docs build
#----------------------------------------------
- name: Build HTML docs
run: uv run sphinx-build -b html -W docs/source/ docs/build/html
test:
timeout-minutes: 45
defaults:
run:
shell: bash
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
python-version: ["3.10", "3.11", "3.12", "3.13", "3.14"]
env:
OS: ${{ matrix.os }}
PYTHON: ${{ matrix.python-version }}
steps:
- name: Check out repository
uses: actions/checkout@v5
- name: Install uv
uses: astral-sh/setup-uv@v6
with:
python-version: ${{ matrix.python-version }}
enable-cache: true
- name: Install library
run: uv sync --locked
- name: Check tests folder existence
id: check_test_files
uses: andstor/file-existence-action@v3
with:
files: "tests"
- name: Run tests
if: steps.check_test_files.outputs.files_exists == 'true'
run: |
uv run python -m pytest --cov=pythontemplate --cov-report term --cov-report xml --junitxml=testresults.xml
uv run coverage report
- name: Upload coverage to Codecov
if: steps.check_test_files.outputs.files_exists == 'true'
uses: codecov/codecov-action@v5
with:
token: ${{ secrets.CODECOV_TOKEN }}
flags: unittests
env_vars: OS,PYTHON
name: Python ${{ matrix.python-version }} on ${{ runner.os }}