Skip to content

Commit b31550a

Browse files
committed
chore: streamline CI with UV and tox-gh-actions
1 parent 27e8773 commit b31550a

File tree

2 files changed

+8
-54
lines changed

2 files changed

+8
-54
lines changed

.github/workflows/test.yml

Lines changed: 8 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -8,39 +8,21 @@ concurrency:
88

99
jobs:
1010
test-package:
11-
name: Test Package (Python ${{ matrix.python-version }}, Django ${{ matrix.django-version }})
11+
name: Test Package (Python ${{ matrix.python-version }})
1212
runs-on: ubuntu-latest
1313
permissions:
1414
id-token: write # Required for Codecov OIDC token
1515
strategy:
1616
fail-fast: false
1717
matrix:
18+
# needs to included every supported python version
19+
# tox-gh-actions will spawn jobs for each django version
1820
python-version:
1921
- '3.10'
2022
- '3.11'
2123
- '3.12'
2224
- '3.13'
23-
django-version:
24-
- '4.2'
25-
- '5.0'
26-
- '5.1'
27-
- '5.2'
28-
- 'main'
29-
include:
30-
# https://docs.djangoproject.com/en/dev/faq/install/#what-python-version-can-i-use-with-django
31-
- python-version: '3.8'
32-
django-version: '4.2'
33-
- python-version: '3.9'
34-
django-version: '4.2'
35-
- python-version: '3.14'
36-
django-version: '5.2'
37-
- python-version: '3.14'
38-
django-version: 'main'
39-
exclude:
40-
- python-version: '3.13'
41-
django-version: '5.0'
42-
- python-version: '3.13'
43-
django-version: '4.2'
25+
- '3.14'
4426

4527
steps:
4628
- uses: actions/checkout@v4
@@ -50,31 +32,11 @@ jobs:
5032
with:
5133
python-version: ${{ matrix.python-version }}
5234

35+
- name: Install uv
36+
uses: hynek/setup-cached-uv@v2
5337

54-
- name: Get pip cache dir
55-
id: pip-cache
56-
run: |
57-
echo "::set-output name=dir::$(pip cache dir)"
58-
59-
- name: Cache
60-
uses: actions/cache@v4
61-
with:
62-
path: ${{ steps.pip-cache.outputs.dir }}
63-
key:
64-
${{ matrix.python-version }}-v1-${{ hashFiles('**/pyproject.toml') }}-${{ hashFiles('**/tox.ini') }}
65-
restore-keys: |
66-
${{ matrix.python-version }}-v1-
67-
68-
- name: Install Python dependencies
69-
run: |
70-
python -m pip install --upgrade pip
71-
python -m pip install --upgrade tox tox-gh-actions
72-
73-
- name: Tox tests
74-
run: |
75-
tox -v
76-
env:
77-
DJANGO: ${{ matrix.django-version }}
38+
- name: 🧪 Run tox targets for Python ${{ matrix.python-version }}
39+
run: uvx --with tox-uv --with tox-gh-actions tox -v
7840

7941
- name: Upload coverage
8042
uses: codecov/codecov-action@v5

tox.ini

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -22,14 +22,6 @@ python =
2222
3.13: py313
2323
3.14: py314
2424

25-
[gh-actions:env]
26-
DJANGO =
27-
4.2: dj42
28-
5.0: dj50
29-
5.1: dj51
30-
5.2: dj52
31-
main: djmain
32-
3325
[testenv]
3426
commands =
3527
pytest {posargs}

0 commit comments

Comments
 (0)