Skip to content

Commit

Permalink
CI: Run tests on supported Django + Python matrix
Browse files Browse the repository at this point in the history
  • Loading branch information
justinmayer committed Jun 14, 2023
1 parent ae08311 commit 354c917
Showing 1 changed file with 34 additions and 3 deletions.
37 changes: 34 additions & 3 deletions .github/workflows/main.yml
Expand Up @@ -2,18 +2,49 @@ name: build

on: [push, pull_request]

env:
PYTEST_ADDOPTS: "--color=yes"

jobs:
test:
name: Test
name: Test - Python ${{ matrix.python-version }} - Django ${{ matrix.django-version }}
runs-on: ubuntu-latest

strategy:
fail-fast: false
matrix:
python-version:
- "3.8"
- "3.9"
- "3.10"
- "3.11"
django-version:
- "3.2"
- "4.1"
- "4.2"
exclude:
# Django 3.2 is compatible with Python <= 3.10
- python-version: "3.11"
django-version: "3.2"

steps:
- uses: actions/checkout@v3

- name: Set up Python
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: "3.9"
python-version: ${{ matrix.python-version }}

- name: Install Django
run: |
python -m pip install --upgrade pip
python -m pip install "Django~=${{ matrix.django-version }}.0"
- name: Python and Django versions
run: |
echo "Python ${{ matrix.python-version }} -> Django ${{ matrix.django-version }}
python --version
echo "Django `django-admin --version`"
- name: Install dependencies
run: python -m pip install -r requirements/testing.txt
Expand Down

0 comments on commit 354c917

Please sign in to comment.