Skip to content

Commit f90993f

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

File tree

2 files changed

+38
-22
lines changed

2 files changed

+38
-22
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: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,25 @@
11
[tox]
22
envlist = lint,py{310,311,312,313,314,314t},pypy3,manifest,coverage-report
33

4-
[gh-actions]
4+
[gh]
55
python =
6-
3.10: py310
7-
3.11: py311
8-
3.12: py312
9-
3.13: py313, lint, manifest
10-
3.14: py314
11-
3.14t: py314t
12-
pypy-3.11: pypy3
6+
3.10 = py310
7+
3.11 = py311
8+
3.12 = py312
9+
3.13 = py313, lint, manifest
10+
3.14 = py314
11+
3.14t = py314t
12+
pypy3.11 = pypy3
1313

1414
[testenv]
1515
deps =
16+
tox >= 4.31
17+
tox-uv >= 1.28.1
1618
pytest
1719
pytest-cov
1820
sh >= 2.0.2, <3
1921
click
20-
py{310,311,312,313,314,314t,pypy3}: ipython
22+
py{310,311,312,313,314,314t},pypy3: ipython
2123
commands = pytest --cov --cov-report=term-missing {posargs}
2224
depends =
2325
py{310,311,312,313,314,314t},pypy3: coverage-clean

0 commit comments

Comments
 (0)