Skip to content

Commit ccf37ef

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

File tree

2 files changed

+30
-14
lines changed

2 files changed

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

4-
[gh-actions]
4+
[gh]
55
python =
66
3.10: py310
77
3.11: py311
@@ -13,6 +13,8 @@ python =
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

0 commit comments

Comments
 (0)