Skip to content

Commit 94b2c57

Browse files
mschoettlejheld
authored andcommitted
ci: add django versions to CI matrix
1 parent 695c469 commit 94b2c57

File tree

1 file changed

+21
-16
lines changed

1 file changed

+21
-16
lines changed

.github/workflows/ci.yml

Lines changed: 21 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,32 +1,36 @@
11
name: CI
22

3-
on: [pull_request, workflow_dispatch]
3+
on:
4+
push:
5+
branches:
6+
- master
7+
pull_request:
8+
workflow_dispatch:
49

510
concurrency:
611
group: ${{ github.workflow }}-${{ github.ref }}
712
cancel-in-progress: true
813

914
jobs:
10-
get-python-versions:
11-
name: Get Python versions
12-
runs-on: ubuntu-latest
13-
outputs:
14-
python-matrix: ${{ steps.get-python-versions-action.outputs.latest-python-versions }}
15-
steps:
16-
- name: Get Python version matrix
17-
uses: snok/latest-python-versions@v1
18-
id: get-python-versions-action
19-
with:
20-
min-version: 3.8
21-
2215
ci:
2316
name: CI
24-
needs: [get-python-versions]
2517
runs-on: ubuntu-latest
2618
strategy:
27-
fail-fast: false
19+
fail-fast: true
20+
max-parallel: 4
2821
matrix:
29-
python-version: ${{ fromJson(needs.get-python-versions.outputs.python-matrix) }}
22+
python-version: [3.8, 3.9, '3.10', 3.11, 3.12]
23+
django-version: [4.2, '5.0', 5.1]
24+
exclude:
25+
# Django 5.0 and 5.1 only support Python 3.10 to 3.12
26+
- python-version: 3.8
27+
django-version: 5.0
28+
- python-version: 3.9
29+
django-version: 5.0
30+
- python-version: 3.8
31+
django-version: 5.1
32+
- python-version: 3.9
33+
django-version: 5.1
3034

3135
steps:
3236
- name: Checkout ${{ github.repository }}
@@ -55,6 +59,7 @@ jobs:
5559
id: poetry-install
5660
run: |
5761
poetry install --no-interaction --no-root
62+
poetry run pip install Django==${{ matrix.django-version }}.*
5863
echo "django_version=$(poetry run django-admin --version)" >> $GITHUB_OUTPUT
5964
6065
- name: Run pre-commit

0 commit comments

Comments
 (0)