Skip to content

Commit bd865d6

Browse files
Parallelize CI workflow by adding Django versions to job matrix (#1219)
* add `django-version` to job matrix * adjust job name * add django 2.2 and adjust exclude matrix * remove max-parallel restriction * change comments to be clearer * remove extra newline * remove whitespace * chore: add success test decouple successful from specific matrix builds to avoid GH admin intervention as we update our supported matrix. --------- Co-authored-by: Darrel O'Pry <[email protected]>
1 parent 13538a6 commit bd865d6

File tree

2 files changed

+34
-1
lines changed

2 files changed

+34
-1
lines changed

.github/workflows/test.yml

Lines changed: 26 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,27 @@ on: [push, pull_request]
44

55
jobs:
66
build:
7+
name: build (Python ${{ matrix.python-version }}, Django ${{ matrix.django-version }})
78
runs-on: ubuntu-latest
89
strategy:
910
fail-fast: false
10-
max-parallel: 5
1111
matrix:
1212
python-version: ['3.7', '3.8', '3.9', '3.10', '3.11']
13+
django-version: ['2.2', '3.2', '4.0', '4.1', 'main']
14+
exclude:
15+
# https://docs.djangoproject.com/en/dev/faq/install/#what-python-version-can-i-use-with-django
16+
17+
# Python 3.10+ is not supported by Django 2.2
18+
- python-version: '3.10'
19+
django-version: '2.2'
20+
21+
# Python 3.7 is not supported by Django 4.0+
22+
- python-version: '3.7'
23+
django-version: '4.0'
24+
- python-version: '3.7'
25+
django-version: '4.1'
26+
- python-version: '3.7'
27+
django-version: 'main'
1328

1429
steps:
1530
- uses: actions/checkout@v2
@@ -42,8 +57,18 @@ jobs:
4257
- name: Tox tests
4358
run: |
4459
tox -v
60+
env:
61+
DJANGO: ${{ matrix.django-version }}
4562

4663
- name: Upload coverage
4764
uses: codecov/codecov-action@v1
4865
with:
4966
name: Python ${{ matrix.python-version }}
67+
68+
success:
69+
needs: build
70+
runs-on: ubuntu-latest
71+
name: Test successful
72+
steps:
73+
- name: Success
74+
run: echo Test successful

tox.ini

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,14 @@ python =
1919
3.10: py310
2020
3.11: py311
2121

22+
[gh-actions:env]
23+
DJANGO =
24+
2.2: dj22
25+
3.2: dj32
26+
4.0: dj40
27+
4.1: dj41
28+
main: djmain
29+
2230
[pytest]
2331
django_find_project = false
2432
addopts =

0 commit comments

Comments
 (0)