Skip to content

Commit a7c00d4

Browse files
committed
Make CI testing more efficient
1 parent ec85cb4 commit a7c00d4

File tree

2 files changed

+41
-13
lines changed

2 files changed

+41
-13
lines changed

.github/workflows/test.yml

Lines changed: 27 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -31,17 +31,31 @@ jobs:
3131
steps:
3232
- uses: actions/checkout@v6
3333

34-
- name: Set up Python ${{ matrix.python-version }}
35-
uses: actions/setup-python@v6
34+
- name: Install the latest version of uv
35+
uses: astral-sh/setup-uv@v7
3636
with:
37-
python-version: ${{ matrix.python-version }}
38-
allow-prereleases: true
39-
40-
- name: Upgrade pip
41-
run: python -m pip install --upgrade pip
42-
43-
- name: Install dependencies
44-
run: pip install tox tox-gh-actions
45-
46-
- name: Test with tox
47-
run: tox
37+
enable-cache: true
38+
cache-dependency-glob: "pyproject.toml"
39+
github-token: ${{ secrets.GITHUB_TOKEN }}
40+
41+
- name: Add .local/bin to Windows PATH
42+
if: runner.os == 'Windows'
43+
shell: bash
44+
run: echo "$USERPROFILE/.local/bin" >> $GITHUB_PATH
45+
46+
- name: Install tox
47+
run: uv tool install --python-preference only-managed --python 3.14 tox --with tox-uv --with tox-gh
48+
49+
- name: Install Python
50+
if: matrix.python-version != '3.14'
51+
run: uv python install --python-preference only-managed ${{ matrix.python-version }}
52+
53+
- name: Setup test suite
54+
run: tox run -vv --notest --skip-missing-interpreters false
55+
env:
56+
TOX_GH_MAJOR_MINOR: ${{ matrix.python-version }}
57+
58+
- name: Run test suite
59+
run: tox run --skip-pkg-install
60+
env:
61+
TOX_GH_MAJOR_MINOR: ${{ matrix.python-version }}

tox.ini

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
[tox]
22
envlist = lint,py{310,311,312,313,314,314t},pypy3,manifest,coverage-report
3+
pass_env =
4+
TOX_GH_MAJOR_MINOR
35

46
[gh-actions]
57
python =
@@ -11,8 +13,20 @@ python =
1113
3.14t: py314t
1214
pypy-3.11: pypy3
1315

16+
[gh]
17+
python =
18+
3.10: py310
19+
3.11: py311
20+
3.12: py312
21+
3.13: py313, lint, manifest
22+
3.14: py314
23+
3.14t: py314t
24+
pypy-3.11: pypy3
25+
1426
[testenv]
1527
deps =
28+
tox >= 4.31
29+
tox-uv >= 1.28.1
1630
pytest
1731
pytest-cov
1832
sh >= 2.0.2, <3

0 commit comments

Comments
 (0)