1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179
|
name: Test django-treebeard
on:
push:
branches:
- master
pull_request:
branches:
- master
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
lint-python:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v5
with:
ref: ${{ github.ref }}
- uses: astral-sh/ruff-action@v3
with:
version: "0.14.x"
- run: ruff check --fix
- run: ruff format --check --diff
test-sqlite:
name: SQlite, Python ${{ matrix.python-version }}, Django ${{ matrix.django-version }}
runs-on: ubuntu-latest
strategy:
fail-fast: true
matrix:
python-version: [3.12, 3.14]
django-version: [52, 60]
steps:
- uses: actions/checkout@v5
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
cache: 'pip'
- name: Install dependencies
run: pip install tox
- name: Run tests
run: tox -e "py-dj${{ matrix.django-version }}-sqlite"
test-postgres:
name: Postgres, Python ${{ matrix.python-version }}, Django ${{ matrix.django-version }}
runs-on: ubuntu-latest
strategy:
fail-fast: true
matrix:
python-version: [3.12, 3.14]
django-version: [52, 60]
services:
postgres:
image: postgres:15
ports:
- 5432/tcp
options: --health-cmd pg_isready --health-interval 10s --health-timeout 5s --health-retries 5
env:
POSTGRES_USER: root
POSTGRES_PASSWORD: treebeard
POSTGRES_DB: treebeard
steps:
- uses: actions/checkout@v5
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
cache: 'pip'
- name: Install dependencies
run: pip install tox
- name: Run tests
env:
DATABASE_USER_POSTGRES: root
DATABASE_PASSWORD: treebeard
DATABASE_HOST: 127.0.0.1
DATABASE_PORT_POSTGRES: ${{ job.services.postgres.ports[5432] }} # get randomly assigned published port
# Postgres covers the entire codebase, so we enforce a coverage check
run: tox -e "py-dj${{ matrix.django-version }}-postgres" -- --cov-fail-under 96
test-mysql:
name: MySQL, Python ${{ matrix.python-version }}, Django ${{ matrix.django-version }}
runs-on: ubuntu-latest
strategy:
fail-fast: true
matrix:
python-version: [3.12, 3.14]
django-version: [52, 60]
services:
mysql:
image: mysql:9.5
options: --health-cmd="mysqladmin ping" --health-interval 10s --health-timeout 5s --health-retries 5
env:
MYSQL_ROOT_PASSWORD: treebeard
ports:
- 3306/tcp
steps:
- uses: actions/checkout@v5
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
cache: 'pip'
- name: Install dependencies
run: pip install tox
- name: Run tests
env:
DATABASE_USER_MYSQL: root
DATABASE_PASSWORD: treebeard
DATABASE_HOST: 127.0.0.1
DATABASE_PORT_MYSQL: ${{ job.services.mysql.ports[3306] }} # get randomly assigned published port
run: tox -e "py-dj${{ matrix.django-version }}-mysql"
test-mariadb:
name: MariaDB, Python ${{ matrix.python-version }}, Django ${{ matrix.django-version }}
runs-on: ubuntu-latest
strategy:
fail-fast: true
matrix:
python-version: [3.12, 3.14]
django-version: [52, 60]
services:
mysql:
image: mariadb:10.6
options: --health-cmd="healthcheck.sh --connect" --health-interval 10s --health-timeout 5s --health-retries 5
env:
MYSQL_ROOT_PASSWORD: treebeard
ports:
- 3306/tcp
steps:
- uses: actions/checkout@v5
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
cache: 'pip'
- name: Install dependencies
run: pip install tox
- name: Run tests
env:
DATABASE_USER_MYSQL: root
DATABASE_PASSWORD: treebeard
DATABASE_HOST: 127.0.0.1
DATABASE_PORT_MYSQL: ${{ job.services.mysql.ports[3306] }} # get randomly assigned published port
run: tox -e "py-dj${{ matrix.django-version }}-mysql"
test-mssql:
name: MSSQL, Python ${{ matrix.python-version }}, Django ${{ matrix.django-version }}
runs-on: ubuntu-latest
strategy:
fail-fast: true
matrix:
python-version: [3.12, 3.14]
django-version: [52] # mssql-django doesn't yet support Django 6
services:
mssql:
image: mcr.microsoft.com/mssql/server:2019-latest
env:
SA_PASSWORD: Password12!
ACCEPT_EULA: 'Y'
ports:
- 1433/tcp
steps:
- uses: actions/checkout@v5
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
cache: 'pip'
- name: Install dependencies
run: pip install tox
- name: Install ODBC driver for MSSQL
run: |
curl -sSL -O https://packages.microsoft.com/config/ubuntu/$(grep VERSION_ID /etc/os-release | cut -d '"' -f 2)/packages-microsoft-prod.deb
sudo dpkg -i packages-microsoft-prod.deb
sudo apt-get update
sudo ACCEPT_EULA=Y apt-get install msodbcsql18 mssql-tools18 -y
- name: Run tests
env:
DATABASE_PORT_MSSQL: ${{ job.services.mssql.ports[1433] }} # get randomly assigned published port
run: tox -e "py-dj${{ matrix.django-version }}-mssql"
|