-
Notifications
You must be signed in to change notification settings - Fork 0
54 lines (49 loc) · 1.67 KB
/
test-pytest.yaml
File metadata and controls
54 lines (49 loc) · 1.67 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
name: Tests
# A reusable github workflow to run:
# - CI test suit:
# - `pytest` for selected OS and python versions
#
# 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 `pytest` configuration is fully specified in project config
# files (eg. `pyproject.toml`).
#
# Uses `uv run pytest` to run the 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: pytest 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
uses: glenn20/python-ci/actions/setup@dev
with:
python-version: ${{ matrix.python-version }}
- name: pytest
run: uv run --frozen pytest