From 354c9177f9463f490fe9ee9508a91184d34ef956 Mon Sep 17 00:00:00 2001 From: Justin Mayer Date: Wed, 14 Jun 2023 14:46:55 +0200 Subject: [PATCH] CI: Run tests on supported Django + Python matrix --- .github/workflows/main.yml | 37 ++++++++++++++++++++++++++++++++++--- 1 file changed, 34 insertions(+), 3 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index a9d750b..3ff5601 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -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