-
Notifications
You must be signed in to change notification settings - Fork 0
60 lines (54 loc) · 2.2 KB
/
test-tox.yaml
File metadata and controls
60 lines (54 loc) · 2.2 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
name: CI using tox
# A reusable github workflow to run CI through tox and tox-gh:
# The CI workflow is configured in the tox-gh config (eg. pyproject.toml).
# See https://github.com/tox-dev/tox-gh.
#
# Accepts the following inputs:
# - `os`: A json string containing the list of operating systems on which to
# run tests. Default is `["ubuntu-latest", "windows-latest",
# "macos-latest"]`.
# - `python-version`: A json string containing the list of python versions on
# which to run tests. Default is `["3.9", "3.10", "3.11", "3.12", "3.13"]`.
#
# Assumes the configurations for all tools (`mypy`, `uv`, `ruff`, `pytest`,
# ...) are fully specified in config files (eg `pyproject.toml`).
#
# Uses `uv run tox` to run the checks and tests.
on:
workflow_call:
inputs:
os:
description: >-
A json string containing the list of operating systems on which to
run the test matrix.
default: '["ubuntu-latest", "windows-latest", "macos-latest"]'
type: string
required: false
python-version:
description: >-
A json string containing the list of python versions on
which to run the test matrix.
default: '["3.9", "3.10", "3.11", "3.12", "3.13"]'
type: string
required: false
jobs:
tests:
name: ci-tox py${{ matrix.python-version }}-${{ matrix.os }}
strategy:
matrix:
os: ${{ fromJson(inputs.os) }}
python-version: ${{ fromJson(inputs.python-version) }}
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4
- name: Checkout and setup python environment ${{ matrix.python-version }}
uses: glenn20/python-ci/actions/setup@dev
with:
python-version: ${{ matrix.python-version }}
# Separate the setup of the tox environment and the running of the tests
# to make it easier to separate issues with the tox environment setup and
# running the tests.
- name: Setup tests # Setup the tox environment for the tests
run: uv run --frozen tox run --notest --skip-missing-interpreters false
- name: Run tests # Use `tox` to run the tests
run: uv run --frozen tox run --skip-pkg-install