Skip to content

Merge pull request #40 from genotrance/dependabot/github_actions/gith… #55

Merge pull request #40 from genotrance/dependabot/github_actions/gith…

Merge pull request #40 from genotrance/dependabot/github_actions/gith… #55

Workflow file for this run

name: "🔬 Test"
on:
pull_request: null
push:
branches:
- "main"
- "releases"
jobs:
test:
name: "Test (${{ matrix.os.name }})"
strategy:
matrix:
os:
- name: "Linux"
runner: "ubuntu-latest"
- name: "macOS"
runner: "macos-latest"
- name: "Windows"
runner: "windows-latest"
# Each operating system should test all Python interpreters simultaneously.
# This nested-list syntax accomplishes that goal
# without creating cross-products of every possible OS and interpreter.
#
# Note: The CPython interpreter versions should be in ascending order
# because the last-listed version will be the default CPython version.
#
cpythons:
- - "3.8"
- "3.9"
- "3.10"
- "3.11"
- "3.12"
cpython-beta:
- "3.13"
fail-fast: false
runs-on: "${{ matrix.os.runner }}"
steps:
- name: "Checkout the repository"
uses: "actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683" # v4.2.2
- name: "Setup Pythons"
uses: "actions/setup-python@42375524e23c412d93fb67b49958b491fce71c38" # v5.4.0
env:
# Disable pip upgrade warnings while setting up Python versions.
PIP_DISABLE_PIP_VERSION_CHECK: "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@d4323d4df104b026a6aa633fdb11d772146be0bf" # v4.2.2
with:
path: |
.mypy_cache/
.tox/
.venv/
key: "test-os=${{ runner.os }}-hash=${{ hashFiles('.python-identifiers', 'pyproject.toml', '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: "Run the test suite"
run: "${{ env.venv-path }}/tox"