Skip to content

Commit

Permalink
ci: add django versions to CI matrix
Browse files Browse the repository at this point in the history
  • Loading branch information
mschoettle committed Aug 30, 2024
1 parent 695c469 commit 9821798
Showing 1 changed file with 18 additions and 17 deletions.
35 changes: 18 additions & 17 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -1,32 +1,33 @@
name: CI

on: [pull_request, workflow_dispatch]
on:
push:
branches:
- master
pull_request:
workflow_dispatch:

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:
get-python-versions:
name: Get Python versions
runs-on: ubuntu-latest
outputs:
python-matrix: ${{ steps.get-python-versions-action.outputs.latest-python-versions }}
steps:
- name: Get Python version matrix
uses: snok/latest-python-versions@v1
id: get-python-versions-action
with:
min-version: 3.8

ci:
name: CI
needs: [get-python-versions]
runs-on: ubuntu-latest
strategy:
fail-fast: false
fail-fast: true
max-parallel: 4
matrix:
python-version: ${{ fromJson(needs.get-python-versions.outputs.python-matrix) }}
python-version: [3.8, 3.9, '3.10', 3.11, 3.12]
django-version: [4.2, '5.0', 5.1]
exclude:
# Django 5.0 only supports Python 3.10 to 3.12
- python-version: 3.8
django-version: 5.0
- python-version: 3.9
django-version: 5.0

steps:
- name: Checkout ${{ github.repository }}
Expand Down Expand Up @@ -55,12 +56,12 @@ jobs:
id: poetry-install
run: |
poetry install --no-interaction --no-root
echo "django_version=$(poetry run django-admin --version)" >> $GITHUB_OUTPUT
poetry run pip install Django==${{ matrix.django-version }}
- name: Run pre-commit
run: poetry run pre-commit run --all-files

- name: Run Tests (Django ${{ steps.poetry-install.outputs.django_version }})
- name: Run Tests (Django ${{ matrix.django-version }})
# enforce failing fast: https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#exit-codes-and-error-action-preference
shell: bash
run: |
Expand Down

0 comments on commit 9821798

Please sign in to comment.