Repository navigation
89 lines (73 loc) · 2.54 KB
/
Copy pathtests-ci.yml
File metadata and controls
89 lines (73 loc) · 2.54 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
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
name: 'tests-ci'
on:
push:
branches: [ "main", "devel" ]
pull_request:
branches: [ "main", "devel" ]
# schedule:
# - cron: "13 20 * * 3"
jobs:
# Python 3.10 and later, running against the development tooling that
# 'uv.lock' pins. These runs are fully reproducible.
tests-ci:
strategy:
#fail-fast: true
matrix:
python-version:
- "3.10"
- "3.11"
- "3.12"
- "3.13"
os:
- 'ubuntu-latest'
runs-on: '${{ matrix.os }}'
steps:
- uses: actions/checkout@v4
- name: 'Set up uv'
uses: astral-sh/setup-uv@v7
with:
enable-cache: true
python-version: '${{ matrix.python-version }}'
- name: 'Run tests'
run: uv run --frozen pytest
# Older pythons, down to the oldest one that the GitHub-hosted runners can
# still provide. 'uv.lock' deliberately covers python 3.10 and later only
# (see [tool.uv.dependency-groups] in pyproject.toml), so pytest is resolved
# on the fly here and uv picks whichever release still supports the
# interpreter. These runs are therefore not pinned; a pytest release could
# in principle break them without any change on our side.
#
# The library is pure python and has no runtime dependencies, so there is
# nothing to build: it is used straight from the source tree via PYTHONPATH.
tests-ci-oldpy:
strategy:
#fail-fast: true
matrix:
python-version:
- "3.7"
- "3.8"
- "3.9"
# 'ubuntu-22.04' is the newest runner image for which 'actions/setup-python'
# still provides python 3.7. uv's own python downloads only start at 3.8,
# which is why the interpreter comes from 'actions/setup-python' here and
# from 'astral-sh/setup-uv' in the job above.
runs-on: 'ubuntu-22.04'
steps:
- uses: actions/checkout@v4
- name: 'Set up python ${{ matrix.python-version }}'
uses: actions/setup-python@v5
with:
python-version: '${{ matrix.python-version }}'
- name: 'Set up uv'
uses: astral-sh/setup-uv@v7
with:
enable-cache: true
# '--no-project' keeps uv from consulting uv.lock (which does not describe
# this interpreter); '$(which python)' is the interpreter that
# 'actions/setup-python' just put on the PATH.
- name: 'Run tests (pytest resolved outside of uv.lock)'
env:
PYTHONPATH: '.'
run: >-
uv run --no-project --python "$(which python)" --with pytest
pytest