Skip to content

update CI test matrix #424

update CI test matrix

update CI test matrix #424

Workflow file for this run

name: test
on: [push, pull_request, workflow_dispatch]
jobs:
postgres:
runs-on: ubuntu-latest
# Service containers to run with `container-job`
env:
RDBMS: postgres
POSTGRES_PASSWORD: postgres
POSTGRES_USER: postgres
POSTGRES_HOST: localhost
POSTGRES_PORT: 5432
strategy:
matrix:
python-version: ['3.8', '3.9', '3.10', '3.11', '3.12', '3.13.0-rc.1']
postgres-version: ['9.6', '12', 'latest']
psycopg-version: ['psycopg2', 'psycopg3']
django-version:
- '3.2' # LTS April 2024
- '4.2' # LTS April 2026
- '5.0' # April 2025
- '5.1' # December 2025
drf-version:
- '3.14'
- '3.15'
filter-version:
- '23.5'
- '24.0'
exclude:
- django-version: '4.2'
postgres-version: '9.6'
- django-version: '5.0'
postgres-version: '9.6'
- python-version: '3.11'
django-version: '3.2'
- python-version: '3.12'
django-version: '3.2'
- postgres-version: '12'
psycopg-version: 'psycopg3'
- django-version: '3.2'
psycopg-version: 'psycopg3'
- python-version: '3.8'
django-version: '5.0'
- python-version: '3.9'
django-version: '5.0'
- django-version: '3.2'
postgres-version: 'latest'
- python-version: '3.8'
django-version: '5.1'
- python-version: '3.9'
django-version: '5.1'
- python-version: '3.13.0-rc.1'
django-version: '3.2'
- python-version: '3.13.0-rc.1'
django-version: '4.2'
- python-version: '3.13.0-rc.1'
django-version: '5.0'
- django-version: '3.2'
drf-version: '3.15'
- django-version: '4.2'
drf-version: '3.14'
- django-version: '5.0'
drf-version: '3.14'
- django-version: '5.1'
drf-version: '3.14'
- django-version: '3.2'
filter-version: '24.0'
- django-version: '4.2'
filter-version: '23.5'
- django-version: '5.0'
filter-version: '23.5'
- django-version: '5.1'
filter-version: '23.5'
# Service containers to run with `runner-job`
services:
# Label used to access the service container
postgres:
# Docker Hub image
image: postgres:${{ matrix.postgres-version }}
# Provide the password for postgres
env:
POSTGRES_PASSWORD: postgres
# Set health checks to wait until postgres has started
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
ports:
# Maps tcp port 5432 on service container to the host
- 5432:5432
steps:
- uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Install Poetry
uses: snok/install-poetry@v1
with:
virtualenvs-create: true
virtualenvs-in-project: true
- name: Install Basic Dependencies
run: |
poetry config virtualenvs.in-project true
poetry run pip install --upgrade pip
poetry add django@^${{ matrix.django-version }}
poetry add django-filter@^${{ matrix.filter-version }}
poetry add djangorestframework@^${{ matrix.drf-version }}
poetry install --no-interaction --with ${{ matrix.psycopg-version }}
- name: No Optional Dependency Unit Tests
run: |
poetry run pytest --cov-append
- name: Install enum-properties
run: |
poetry install -E properties
- name: Unit Tests w/ enum-properties
run: |
poetry run pytest --cov-append
- name: Remove enum-properties
run: |
poetry run pip uninstall -y enum-properties
- name: Install djangorestframework
run: |
poetry install -E djangorestframework
- name: Run Unit Tests w/ djangorestframework
run: |
poetry run pytest --cov-append
- name: Install django-filters
run: |
poetry install -E filters
- name: Run Unit Tests w/ django-filter
run: |
poetry run pytest --cov-append
- name: Install all deps
run: |
poetry install -E all
- name: Run Full Unit Tests
run: |
poetry run pytest --cov-append
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v4
with:
token: ${{ secrets.CODECOV_TOKEN }}
file: ./coverage.xml
sqlite:
runs-on: ubuntu-latest
env:
RDBMS: sqlite
strategy:
matrix:
python-version: [ '3.8', '3.12']
mysqlclient-version: ['^1.0.3']
django-version:
- '3.2' # LTS April 2024
- '4.2' # LTS April 2026
- '5.1' # December 2025
drf-version:
- '3.14'
- '3.15'
filter-version:
- '23.5'
- '24.0'
exclude:
- python-version: '3.8'
django-version: '5.1'
- python-version: '3.12'
django-version: '3.2'
- djang-version: '3.2'

Check failure on line 179 in .github/workflows/test.yml

View workflow run for this annotation

GitHub Actions / test

Invalid workflow file

The workflow is not valid. .github/workflows/test.yml (Line: 179, Col: 13): Matrix exclude key 'djang-version' does not match any key within the matrix .github/workflows/test.yml (Line: 181, Col: 13): Matrix exclude key 'djang-version' does not match any key within the matrix
drf-version: '3.15'
- djang-version: '3.2'
filter-version: '24.0'
- djang-version: '4.2'
drf-version: '3.14'
- djang-version: '4.2'
filter-version: '23.5'
- djang-version: '5.1'
drf-version: '3.14'
- djang-version: '5.1'
filter-version: '23.5'
steps:
- uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Install Poetry
uses: snok/install-poetry@v1
with:
virtualenvs-create: true
virtualenvs-in-project: true
- name: Install Dependencies
run: |
poetry config virtualenvs.in-project true
poetry run pip install --upgrade pip
poetry add django@^${{ matrix.django-version }}
poetry add django-filter@^${{ matrix.filter-version }}
poetry add djangorestframework@^${{ matrix.drf-version }}
poetry install --no-interaction -E all
- name: Run Full Unit Tests
run: |
poetry run pytest
mysql:
runs-on: ubuntu-latest
env:
RDBMS: mysql
strategy:
matrix:
python-version: [ '3.8', '3.12']
mysql-version: ['5.7', 'latest']
mysqlclient-version: ['1.4.3', '']
django-version:
- '3.2' # LTS April 2024
- '4.2' # LTS April 2026
- '5.1' # December 2025
drf-version:
- '3.14'
- '3.15'
filter-version:
- '23.5'
- '24.0'
exclude:
- python-version: '3.12'
django-version: '3.2'
- python-version: '3.8'
django-version: '5.1'
- django-version: '3.2'
mysql-version: 'latest'
- django-version: '4.2'
mysql-version: '5.7'
- django-version: '5.1'
mysql-version: '5.7'
- mysql-version: '5.7'
mysqlclient-version: ''
- mysql-version: 'latest'
mysqlclient-version: '1.4.3'
- djang-version: '3.2'
drf-version: '3.15'
- djang-version: '3.2'
filter-version: '24.0'
- djang-version: '4.2'
drf-version: '3.14'
- djang-version: '4.2'
filter-version: '23.5'
- djang-version: '5.1'
drf-version: '3.14'
- djang-version: '5.1'
filter-version: '23.5'
services:
mysql:
# Docker Hub image
image: mysql:${{ matrix.mysql-version }}
# Provide the password for mysql
env:
MYSQL_ROOT_PASSWORD: root
MYSQL_DATABASE: test
# Set health checks to wait until mysql has started
options: >-
--health-cmd "mysqladmin ping"
--health-interval 10s
--health-timeout 5s
--health-retries 5
ports:
# Maps tcp port 3306 on service container to the host
- 3306:3306
steps:
- uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Install Poetry
uses: snok/install-poetry@v1
with:
virtualenvs-create: true
virtualenvs-in-project: true
- name: Install Dependencies
run: |
poetry config virtualenvs.in-project true
poetry run pip install --upgrade pip
poetry add django@^${{ matrix.django-version }}
poetry add django-filter@^${{ matrix.filter-version }}
poetry add djangorestframework@^${{ matrix.drf-version }}
poetry install -E all --with mysql
- name: Install mysqlclient if needed
if: ${{ matrix.mysqlclient-version != '' }}
run: poetry run pip install -U mysqlclient=="${{ matrix.mysqlclient-version }}"
- name: Run Full Unit Tests
env:
MYSQL_VERSION: ${{ matrix.mysql-version }}
run: |
poetry run pytest
mariadb:
runs-on: ubuntu-latest
env:
RDBMS: mariadb
strategy:
matrix:
python-version: [ '3.8', '3.12']
mysqlclient-version: ['1.4.3', '']
mariadb-version: ['10.2', 'latest']
mariadb-healthcheck: ["mysqladmin ping", "healthcheck.sh --connect --innodb_initialized"]
django-version:
- '3.2' # LTS April 2024
- '4.2' # LTS April 2026
- '5.1' # December 2025
drf-version:
- '3.14'
- '3.15'
filter-version:
- '23.5'
- '24.0'
exclude:
- python-version: '3.12'
django-version: '3.2'
- python-version: '3.8'
django-version: '5.1'
- django-version: '3.2'
mariadb-version: 'latest'
- django-version: '4.2'
mariadb-version: '10.2'
- django-version: '5.1'
mariadb-version: '10.2'
- mariadb-version: '10.2'
mysqlclient-version: ''
- mariadb-version: 'latest'
mysqlclient-version: '1.4.3'
- mariadb-version: 'latest'
mariadb-healthcheck: "mysqladmin ping"
- mariadb-version: '10.2'
mariadb-healthcheck: "healthcheck.sh --connect --innodb_initialized"
- djang-version: '3.2'
drf-version: '3.15'
- djang-version: '3.2'
filter-version: '24.0'
- djang-version: '4.2'
drf-version: '3.14'
- djang-version: '4.2'
filter-version: '23.5'
- djang-version: '5.1'
drf-version: '3.14'
- djang-version: '5.1'
filter-version: '23.5'
services:
mysql:
# Docker Hub image
image: mariadb:${{ matrix.mariadb-version }}
# Provide the password for mysql
env:
MYSQL_ROOT_PASSWORD: root
MYSQL_DATABASE: test
# Set health checks to wait until mysql has started
options: >-
--health-cmd="${{ matrix.mariadb-healthcheck }}"
--health-interval 10s
--health-timeout 5s
--health-retries 5
ports:
# Maps tcp port 3306 on service container to the host
- 3306:3306
steps:
- uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Install Poetry
uses: snok/install-poetry@v1
with:
virtualenvs-create: true
virtualenvs-in-project: true
- name: Install Dependencies
run: |
poetry config virtualenvs.in-project true
poetry run pip install --upgrade pip
poetry add django@^${{ matrix.django-version }}
poetry add django-filter@^${{ matrix.filter-version }}
poetry add djangorestframework@^${{ matrix.drf-version }}
poetry install -E all --with mysql
- name: Install mysqlclient if needed
if: ${{ matrix.mysqlclient-version != '' }}
run: poetry run pip install -U mysqlclient=="${{ matrix.mysqlclient-version }}"
- name: Run Full Unit Tests
run: |
poetry run pytest
oracle:
runs-on: ubuntu-latest
env:
RDBMS: oracle
strategy:
matrix:
python-version: ['3.8', '3.10', '3.12']
django-version:
- '3.2' # LTS April 2024
- '4.2' # LTS April 2026
- '5.1' # April 2025
oracle-version:
- '18'
- 'latest'
drf-version:
- '3.14'
- '3.15'
filter-version:
- '23.5'
- '24.0'
exclude:
- python-version: '3.8'
django-version: '5.1'
- python-version: '3.10'
django-version: '5.1'
- python-version: '3.10'
django-version: '3.2'
- python-version: '3.12'
django-version: '3.2'
- python-version: '3.12'
django-version: '4.2'
- python-version: '3.8'
django-version: '4.2'
- django-version: '3.2'
oracle-version: 'latest'
- django-version: '4.2'
oracle-version: '18'
- django-version: '5.1'
oracle-version: '18'
- djang-version: '3.2'
drf-version: '3.15'
- djang-version: '3.2'
filter-version: '24.0'
- djang-version: '4.2'
drf-version: '3.14'
- djang-version: '4.2'
filter-version: '23.5'
- djang-version: '5.1'
drf-version: '3.14'
- djang-version: '5.1'
filter-version: '23.5'
services:
oracle:
image: gvenzl/oracle-xe:${{ matrix.oracle-version }}
env:
ORACLE_PASSWORD: password
# Forward Oracle port
ports:
- 1521:1521
# Provide healthcheck script options for startup
options: >-
--health-cmd healthcheck.sh
--health-interval 10s
--health-timeout 5s
--health-retries 10
steps:
- uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Set Variables
# oracle bug is encountered in Linux CI - does not manifest using same
# oracle DB containers on OSX
run: |
echo "IGNORE_ORA_01843=True" >> $GITHUB_ENV
echo "IGNORE_ORA_00932=True" >> $GITHUB_ENV
- name: Install Poetry
uses: snok/install-poetry@v1
with:
virtualenvs-create: true
virtualenvs-in-project: true
- name: Install Oracle Client
run: |
curl --output oracle-client.rpm https://download.oracle.com/otn_software/linux/instantclient/2111000/oracle-instantclient-basiclite-21.11.0.0.0-1.el8.x86_64.rpm
sudo apt install alien libaio1
sudo alien -i oracle-client.rpm
sudo sh -c 'echo /usr/lib/oracle/21/client64/lib/ > /etc/ld.so.conf.d/oracle.conf'
sudo ldconfig
- name: Install Dependencies
run: |
poetry config virtualenvs.in-project true
poetry run pip install --upgrade pip
poetry add django@^${{ matrix.django-version }}
poetry add django-filter@^${{ matrix.filter-version }}
poetry add djangorestframework@^${{ matrix.drf-version }}
poetry install -E all --with oracle
# - name: Setup tmate session
# uses: mxschmitt/action-tmate@v3
# with:
# detached: true
# timeout-minutes: 60
- name: Run Full Unit Tests
run: |
poetry run pytest -s