Skip to content

Merge pull request #54 from kurtmckee/dependabot/github_actions/githu… #110

Merge pull request #54 from kurtmckee/dependabot/github_actions/githu…

Merge pull request #54 from kurtmckee/dependabot/github_actions/githu… #110

Workflow file for this run

name: "🔬 Test"
on:
pull_request:
push:
branches:
- "main"
- "releases"
jobs:
test:
name: "${{ matrix.os.name }}"
runs-on: "${{ matrix.os.id }}"
strategy:
matrix:
os:
- id: "ubuntu-latest"
name: "Ubuntu"
- id: "macos-latest"
name: "macOS"
- id: "windows-latest"
name: "Windows"
cpythons:
# This list-in-list syntax creates a single-element list,
# and that single element is a full list of Python versions.
# It means each runner will receive a list of all Python versions.
- - "3.8"
- "3.9"
- "3.10"
- "3.11"
- "3.12"
cpython-beta:
- "3.13"
steps:
- name: "Checkout branch"
uses: "actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332" # v4.1.7
- name: "Setup Pythons"
id: "setup-python"
uses: "actions/setup-python@39cd14951b08e74b54015e9e001cdefcf80e669f" # v5.1.1
with:
python-version: "${{
format(
'{0}\n{1}',
matrix.cpython-beta,
join(matrix.cpythons, '\n')
)
}}"
allow-prereleases: true
- name: "Detect Pythons"
uses: "kurtmckee/detect-pythons@38187a5464f266e93e5c1467699f7be2bf521d2e" # v1.1.0
- name: "Restore cache"
id: "restore-cache"
uses: "actions/cache@0c45773b623bea8c8e75f6c82b208c3cf94ea4f9" # v4.0.2
with:
path: |
.mypy_cache/
.tox/
.venv/
key: "test-os=${{ runner.os }}-hash=${{ hashFiles('.python-identifiers', 'tox.ini', 'requirements/*/*.txt') }}"
- name: "Identify venv path"
shell: "bash"
run: |
echo "venv-path=.venv/${{ runner.os == 'Windows' && 'Scripts' || 'bin' }}" >> "$GITHUB_ENV"
- name: "Create a virtual environment"
if: "steps.restore-cache.outputs.cache-hit == false"
run: |
python -m venv .venv
${{ env.venv-path }}/python -m pip install --upgrade pip setuptools wheel
${{ env.venv-path }}/pip install tox
- name: "Test"
run: |
${{ env.venv-path }}/tox run --colored yes -e py${{ join(matrix.cpythons, ',py') }},py${{ matrix.cpython-beta }},coverage-report-ci,mypy
- name: "Docs"
if: "matrix.os.name == 'Ubuntu'"
run: |
${{ env.venv-path }}/tox run --colored yes -e docs