Skip to content

Commit

Permalink
Broaden the test matrix
Browse files Browse the repository at this point in the history
  • Loading branch information
Andy Babic committed Dec 22, 2024
1 parent 30eb4e2 commit 2ad5eab
Show file tree
Hide file tree
Showing 2 changed files with 61 additions and 5 deletions.
59 changes: 55 additions & 4 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,14 +25,65 @@ env:
PIP_CACHE_DIR: ${{ github.workspace }}/.pip-cache

jobs:
test-lts:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
python-version: ["3.11"]
django: ["4.2"]
wagtail: ["5.2"]
db: ["sqlite", "postgres"]

services:
postgres:
image: postgres:15
env:
POSTGRES_PASSWORD: postgres
ports:
- 5432:5432
options: --health-cmd pg_isready --health-interval 10s --health-timeout 5s --health-retries 5

steps:
- name: 📥 Checkout repository
uses: actions/checkout@v4

- name: 🐍 Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
cache: 'pip'
cache-dependency-path: |
pyproject.toml
tox.ini
- name: 📦 Install dependencies
run: |
python -Im pip install --upgrade pip flit tox tox-gh-actions || (echo "::error::Failed to install dependencies" && exit 1)
- name: 💾 Cache tox environments
uses: actions/cache@v4
with:
path: .tox
key: tox-${{ runner.os }}-${{ matrix.python-version }}-${{ matrix.django }}-${{ matrix.wagtail }}-${{ hashFiles('tox.ini') }}

- name: 🏗️ Build wheel
run: python -Im flit build --format wheel || (echo "::error::Failed to build wheel" && exit 1)

- name: 🧪 Run tests
env:
TOXENV: py${{ matrix.python-version }}-django${{ matrix.django }}-wagtail${{ matrix.wagtail }}-sqlite
run: |
tox --installpkg ./dist/*.whl || (echo "::error::Tests failed" && exit 1)
test-sqlite:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
python-version: ["3.11", "3.12"]
django: ["5.1"]
wagtail: ["6.2", "6.3"]
django: ["5.0", "5.2"]
wagtail: ["6.0", "6.2", "6.3"]
db: ["sqlite"]

steps:
Expand Down Expand Up @@ -81,8 +132,8 @@ jobs:
fail-fast: false
matrix:
python-version: ["3.12"]
django: ["5.1"]
wagtail: ["6.2", "6.3"]
django: ["5.0", "5.1"]
wagtail: ["6.0", "6.2", "6.3"]
db: ["postgres"]

services:
Expand Down
7 changes: 6 additions & 1 deletion tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
min_version = 4.11

envlist =
py{3.11,3.12}-django{5.1}-wagtail{6.2,6.3}
py{3.11,3.12}-django{4.2,5.0,5.1,5.2}-wagtail{5.2,6.0,6.1,6.2,6.3}

[gh-actions]
python =
Expand Down Expand Up @@ -31,7 +31,12 @@ setenv =
extras = testing

deps =
django5.0: Django>=5.0,<5.1
django5.1: Django>=5.1,<5.2
django5.2: Django>=5.2,<5.3
wagtail5.2: wagtail>=5.2,<6.0
wagtail6.0: wagtail>=6.0,<6.1
wagtail6.1: wagtail>=6.1,<6.2
wagtail6.2: wagtail>=6.2,<6.3
wagtail6.3: wagtail>=6.3,<6.4
postgres: psycopg2>=2.9
Expand Down

0 comments on commit 2ad5eab

Please sign in to comment.