| 1 |
name: Test |
| 2 |
|
| 3 |
permissions: |
| 4 |
contents: read |
| 5 |
|
| 6 |
concurrency: |
| 7 |
group: test-${{ github.event.pull_request.number || github.ref }} |
| 8 |
cancel-in-progress: true |
| 9 |
|
| 10 |
on: |
| 11 |
push: |
| 12 |
tags-ignore: |
| 13 |
- "*" |
| 14 |
branches: ["main"] |
| 15 |
pull_request: |
| 16 |
branches: ["main"] |
| 17 |
paths: |
| 18 |
- "src/**" |
| 19 |
- ".github/workflows/test.yml" |
| 20 |
- "pyproject.toml" |
| 21 |
- "justfile" |
| 22 |
merge_group: |
| 23 |
workflow_call: |
| 24 |
workflow_dispatch: |
| 25 |
inputs: |
| 26 |
debug: |
| 27 |
description: "Open ssh debug session." |
| 28 |
required: true |
| 29 |
default: false |
| 30 |
type: boolean |
| 31 |
clear_cache: |
| 32 |
description: "Clear GitHub Tool cache." |
| 33 |
required: true |
| 34 |
default: false |
| 35 |
type: boolean |
| 36 |
schedule: |
| 37 |
# Every Sunday at 9:00 AM Los Angeles time. |
| 38 |
# GitHub cron is UTC; 09:00 PT == 17:00 UTC (PST). |
| 39 |
- cron: "0 17 * * 0" |
| 40 |
|
| 41 |
jobs: |
| 42 |
postgres: |
| 43 |
runs-on: ubuntu-latest |
| 44 |
permissions: |
| 45 |
contents: read |
| 46 |
# Service containers to run with `container-job` |
| 47 |
strategy: |
| 48 |
fail-fast: false |
| 49 |
matrix: |
| 50 |
python-version: ["3.10", "3.11", "3.12", "3.13", "3.14"] |
| 51 |
postgres-version: ["12", "14", "latest"] |
| 52 |
psycopg-version: ["psycopg2", "psycopg3"] |
| 53 |
django-version: |
| 54 |
- "dj42" # LTS April 2026 |
| 55 |
- "dj52" # LTS April 2028 |
| 56 |
- "dj61" # |
| 57 |
exclude: |
| 58 |
- python-version: "3.10" |
| 59 |
django-version: "dj61" |
| 60 |
- python-version: "3.11" |
| 61 |
django-version: "dj61" |
| 62 |
|
| 63 |
- python-version: "3.13" |
| 64 |
django-version: "dj42" |
| 65 |
|
| 66 |
- python-version: "3.14" |
| 67 |
django-version: "dj42" |
| 68 |
- python-version: "3.14" |
| 69 |
django-version: "dj52" |
| 70 |
|
| 71 |
- postgres-version: "12" |
| 72 |
django-version: "dj52" |
| 73 |
- postgres-version: "12" |
| 74 |
django-version: "dj61" |
| 75 |
- postgres-version: "14" |
| 76 |
django-version: "dj61" |
| 77 |
|
| 78 |
- postgres-version: "latest" |
| 79 |
django-version: "dj42" |
| 80 |
|
| 81 |
- postgres-version: "12" |
| 82 |
psycopg-version: "psycopg3" |
| 83 |
- postgres-version: "latest" |
| 84 |
psycopg-version: "psycopg2" |
| 85 |
|
| 86 |
# https://github.com/psycopg/psycopg2/pull/1695 |
| 87 |
- python-version: "3.13" |
| 88 |
psycopg-version: "psycopg2" |
| 89 |
- python-version: "3.14" |
| 90 |
psycopg-version: "psycopg2" |
| 91 |
|
| 92 |
# pin each image to its digest (satisfies zizmor unpinned-images) |
| 93 |
# while keeping postgres-version driving the matrix |
| 94 |
include: |
| 95 |
- postgres-version: "12" |
| 96 |
postgres-image: "postgres:12@sha256:2f2a8c2a7d10862e7fba2602e304523554f9df8244c632dafe2628ccb398fb5c" |
| 97 |
- postgres-version: "14" |
| 98 |
postgres-image: "postgres:14@sha256:bbb8851608e3ff4901156bf6a4bf90735a9d44ae014c03811bfdb2f9c354b18b" |
| 99 |
- postgres-version: "latest" |
| 100 |
postgres-image: "postgres:latest@sha256:8ff36f3c66371cba71d20ceedccfc3de9669a68737607888c4ef0af93abe8e39" |
| 101 |
|
| 102 |
env: |
| 103 |
RDBMS: postgres |
| 104 |
POSTGRES_PASSWORD: postgres |
| 105 |
PGPASSWORD: postgres |
| 106 |
POSTGRES_USER: postgres |
| 107 |
POSTGRES_HOST: localhost |
| 108 |
POSTGRES_PORT: 5432 |
| 109 |
COVERAGE_FILE: linux-py${{ matrix.python-version }}-${{ matrix.django-version }}-${{ matrix.psycopg-version }}-pg${{ matrix.postgres-version }}.coverage |
| 110 |
TEST_PYTHON_VERSION: ${{ matrix.python-version }} |
| 111 |
TEST_DJANGO_VERSION: ${{ matrix.django-version }} |
| 112 |
TEST_DATABASE_CLIENT_VERSION: ${{ matrix.psycopg-version }} |
| 113 |
TEST_DATABASE_VERSION: ${{ matrix.postgres-version }} |
| 114 |
|
| 115 |
# Service containers to run with `runner-job` |
| 116 |
services: |
| 117 |
# Label used to access the service container |
| 118 |
postgres: |
| 119 |
# Docker Hub image |
| 120 |
image: ${{ matrix.postgres-image }} |
| 121 |
# Provide the password for postgres |
| 122 |
env: |
| 123 |
POSTGRES_PASSWORD: postgres |
| 124 |
# Set health checks to wait until postgres has started |
| 125 |
options: >- |
| 126 |
--health-cmd pg_isready |
| 127 |
--health-interval 10s |
| 128 |
--health-timeout 5s |
| 129 |
--health-retries 5 |
| 130 |
ports: |
| 131 |
# Maps tcp port 5432 on service container to the host |
| 132 |
- 5432:5432 |
| 133 |
|
| 134 |
steps: |
| 135 |
- name: Clear Tool cache |
| 136 |
if: ${{ github.event.inputs.clear_cache == 'true' }} |
| 137 |
run: sudo rm -rf /opt/hostedtoolcache |
| 138 |
- uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 |
| 139 |
with: |
| 140 |
persist-credentials: false |
| 141 |
- name: Set up Python ${{ matrix.python-version }} |
| 142 |
id: sp |
| 143 |
uses: actions/setup-python@ece7cb06caefa5fff74198d8649806c4678c61a1 |
| 144 |
with: |
| 145 |
python-version: ${{ matrix.python-version }} |
| 146 |
allow-prereleases: true |
| 147 |
- name: Create test databases |
| 148 |
run: | |
| 149 |
psql -h localhost -p 5432 -U postgres -d postgres -c "CREATE DATABASE test1;" |
| 150 |
psql -h localhost -p 5432 -U postgres -d postgres -c "CREATE DATABASE test2;" |
| 151 |
- name: Install uv |
| 152 |
uses: astral-sh/setup-uv@fac544c07dec837d0ccb6301d7b5580bf5edae39 |
| 153 |
with: |
| 154 |
enable-cache: false |
| 155 |
- name: Setup Just |
| 156 |
uses: extractions/setup-just@53165ef7e734c5c07cb06b3c8e7b647c5aa16db3 |
| 157 |
- name: Install Emacs |
| 158 |
if: ${{ github.event.inputs.debug == 'true' }} |
| 159 |
run: | |
| 160 |
sudo apt install emacs |
| 161 |
- name: Setup tmate session |
| 162 |
if: ${{ github.event.inputs.debug == 'true' }} |
| 163 |
uses: mxschmitt/action-tmate@35b54afac29c97fb54faba5b513f8fbd1882f113 |
| 164 |
timeout-minutes: 60 |
| 165 |
- name: Run Unit Tests |
| 166 |
env: |
| 167 |
TEST_PYTHON: ${{ steps.sp.outputs.python-path }} |
| 168 |
run: | |
| 169 |
just test-all --group "$TEST_DATABASE_CLIENT_VERSION" -p "$TEST_PYTHON" --group "$TEST_DJANGO_VERSION" |
| 170 |
- name: Store coverage files |
| 171 |
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a |
| 172 |
with: |
| 173 |
name: ${{ env.COVERAGE_FILE }} |
| 174 |
path: ${{ env.COVERAGE_FILE }} |
| 175 |
|
| 176 |
sqlite: |
| 177 |
runs-on: ubuntu-latest |
| 178 |
permissions: |
| 179 |
contents: read |
| 180 |
env: |
| 181 |
RDBMS: sqlite |
| 182 |
COVERAGE_FILE: linux-py${{ matrix.python-version }}-${{ matrix.django-version }}-sqlite.coverage |
| 183 |
TEST_PYTHON_VERSION: ${{ matrix.python-version }} |
| 184 |
TEST_DJANGO_VERSION: ${{ matrix.django-version }} |
| 185 |
TEST_DATABASE_VERSION: "sqlite" |
| 186 |
strategy: |
| 187 |
fail-fast: false |
| 188 |
matrix: |
| 189 |
python-version: ["3.10", "3.12", "3.14"] |
| 190 |
django-version: |
| 191 |
- "dj42" # LTS April 2026 |
| 192 |
- "dj52" # LTS April 2028 |
| 193 |
- "dj61" # |
| 194 |
exclude: |
| 195 |
- python-version: "3.10" |
| 196 |
django-version: "dj52" |
| 197 |
- python-version: "3.10" |
| 198 |
django-version: "dj61" |
| 199 |
|
| 200 |
- python-version: "3.12" |
| 201 |
django-version: "dj42" |
| 202 |
- python-version: "3.12" |
| 203 |
django-version: "dj61" |
| 204 |
|
| 205 |
- python-version: "3.14" |
| 206 |
django-version: "dj42" |
| 207 |
- python-version: "3.14" |
| 208 |
django-version: "dj52" |
| 209 |
|
| 210 |
steps: |
| 211 |
- name: Clear Tool cache |
| 212 |
if: ${{ github.event.inputs.clear_cache == 'true' }} |
| 213 |
run: sudo rm -rf /opt/hostedtoolcache |
| 214 |
- uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 |
| 215 |
with: |
| 216 |
persist-credentials: false |
| 217 |
- name: Set up Python ${{ matrix.python-version }} |
| 218 |
uses: actions/setup-python@ece7cb06caefa5fff74198d8649806c4678c61a1 |
| 219 |
id: sp |
| 220 |
with: |
| 221 |
python-version: ${{ matrix.python-version }} |
| 222 |
allow-prereleases: true |
| 223 |
- name: Install uv |
| 224 |
uses: astral-sh/setup-uv@fac544c07dec837d0ccb6301d7b5580bf5edae39 |
| 225 |
with: |
| 226 |
enable-cache: false |
| 227 |
- name: Setup Just |
| 228 |
uses: extractions/setup-just@53165ef7e734c5c07cb06b3c8e7b647c5aa16db3 |
| 229 |
- name: Install Emacs |
| 230 |
if: ${{ github.event.inputs.debug == 'true' }} |
| 231 |
run: | |
| 232 |
sudo apt install emacs |
| 233 |
- name: Setup tmate session |
| 234 |
if: ${{ github.event.inputs.debug == 'true' }} |
| 235 |
uses: mxschmitt/action-tmate@35b54afac29c97fb54faba5b513f8fbd1882f113 |
| 236 |
timeout-minutes: 60 |
| 237 |
- name: Run Unit Tests |
| 238 |
env: |
| 239 |
TEST_PYTHON: ${{ steps.sp.outputs.python-path }} |
| 240 |
run: | |
| 241 |
just test-all -p "$TEST_PYTHON" --group "$TEST_DJANGO_VERSION" |
| 242 |
- name: Store coverage files |
| 243 |
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a |
| 244 |
with: |
| 245 |
name: ${{ env.COVERAGE_FILE }} |
| 246 |
path: ${{ env.COVERAGE_FILE }} |
| 247 |
|
| 248 |
mysql: |
| 249 |
runs-on: ubuntu-latest |
| 250 |
permissions: |
| 251 |
contents: read |
| 252 |
strategy: |
| 253 |
fail-fast: false |
| 254 |
matrix: |
| 255 |
python-version: ["3.10", "3.12", "3.14"] |
| 256 |
mysql-version: ["8.0", "latest"] |
| 257 |
mysqlclient-version: ["mysqlclient14", "mysqlclient2x"] |
| 258 |
django-version: |
| 259 |
- "dj42" # LTS April 2024 |
| 260 |
- "dj52" # LTS April 2028 |
| 261 |
- "dj61" # |
| 262 |
exclude: |
| 263 |
- django-version: "dj42" |
| 264 |
mysql-version: "latest" |
| 265 |
|
| 266 |
- django-version: "dj61" |
| 267 |
mysql-version: "8.0" |
| 268 |
|
| 269 |
- mysql-version: "latest" |
| 270 |
mysqlclient-version: "mysqlclient14" |
| 271 |
|
| 272 |
- python-version: "3.12" |
| 273 |
django-version: "dj42" |
| 274 |
- python-version: "3.14" |
| 275 |
django-version: "dj42" |
| 276 |
|
| 277 |
- python-version: "3.10" |
| 278 |
django-version: "dj52" |
| 279 |
- python-version: "3.14" |
| 280 |
django-version: "dj52" |
| 281 |
- django-version: "dj52" |
| 282 |
mysqlclient-version: "mysqlclient14" |
| 283 |
|
| 284 |
- python-version: "3.10" |
| 285 |
django-version: "dj61" |
| 286 |
- python-version: "3.12" |
| 287 |
django-version: "dj61" |
| 288 |
|
| 289 |
# pin each image to its digest (satisfies zizmor unpinned-images) |
| 290 |
# while keeping mysql-version driving the matrix |
| 291 |
include: |
| 292 |
- mysql-version: "8.0" |
| 293 |
mysql-image: "mysql:8.0@sha256:7dcddc01f13bab2f15cde676d44d01f61fc9f99fe7785e86196dfc07d358ae2b" |
| 294 |
- mysql-version: "latest" |
| 295 |
mysql-image: "mysql:latest@sha256:c11782aa2a96624c1efc121768641d96954faa136d6aa82751b032d8c426ffbc" |
| 296 |
|
| 297 |
env: |
| 298 |
RDBMS: mysql |
| 299 |
MYSQL_VERSION: ${{ matrix.mysql-version }} |
| 300 |
COVERAGE_FILE: linux-py${{ matrix.python-version }}-${{ matrix.django-version }}-${{ matrix.mysqlclient-version }}-mysql${{ matrix.mysql-version }}.coverage |
| 301 |
TEST_PYTHON_VERSION: ${{ matrix.python-version }} |
| 302 |
TEST_DJANGO_VERSION: ${{ matrix.django-version }} |
| 303 |
TEST_DATABASE_CLIENT_VERSION: ${{ matrix.mysqlclient-version }} |
| 304 |
TEST_DATABASE_VERSION: ${{ matrix.mysql-version }} |
| 305 |
|
| 306 |
services: |
| 307 |
mysql: |
| 308 |
# Docker Hub image |
| 309 |
image: ${{ matrix.mysql-image }} |
| 310 |
# Provide the password for mysql |
| 311 |
env: |
| 312 |
MYSQL_ROOT_PASSWORD: root |
| 313 |
MYSQL_MULTIPLE_DATABASES: test1,test2 |
| 314 |
# Set health checks to wait until mysql has started |
| 315 |
options: >- |
| 316 |
--health-cmd "mysqladmin ping" |
| 317 |
--health-interval 10s |
| 318 |
--health-timeout 5s |
| 319 |
--health-retries 5 |
| 320 |
ports: |
| 321 |
# Maps tcp port 3306 on service container to the host |
| 322 |
- 3306:3306 |
| 323 |
|
| 324 |
steps: |
| 325 |
# make text comparisons case sensitive (some tests) |
| 326 |
- name: Set default collation for MySQL |
| 327 |
run: | |
| 328 |
mysql -h 127.0.0.1 -u root -proot <<EOF |
| 329 |
SET GLOBAL character_set_server='utf8mb4'; |
| 330 |
SET GLOBAL collation_server='utf8mb4_0900_as_cs'; |
| 331 |
EOF |
| 332 |
- name: Clear Tool cache |
| 333 |
if: ${{ github.event.inputs.clear_cache == 'true' }} |
| 334 |
run: sudo rm -rf /opt/hostedtoolcache |
| 335 |
- uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 |
| 336 |
with: |
| 337 |
persist-credentials: false |
| 338 |
- name: Set up Python ${{ matrix.python-version }} |
| 339 |
uses: actions/setup-python@ece7cb06caefa5fff74198d8649806c4678c61a1 |
| 340 |
id: sp |
| 341 |
with: |
| 342 |
python-version: ${{ matrix.python-version }} |
| 343 |
allow-prereleases: true |
| 344 |
- name: Install Emacs |
| 345 |
if: ${{ github.event.inputs.debug == 'true' }} |
| 346 |
run: | |
| 347 |
sudo apt install emacs |
| 348 |
- name: Setup tmate session |
| 349 |
if: ${{ github.event.inputs.debug == 'true' }} |
| 350 |
uses: mxschmitt/action-tmate@35b54afac29c97fb54faba5b513f8fbd1882f113 |
| 351 |
timeout-minutes: 60 |
| 352 |
- name: Install uv |
| 353 |
uses: astral-sh/setup-uv@fac544c07dec837d0ccb6301d7b5580bf5edae39 |
| 354 |
with: |
| 355 |
enable-cache: false |
| 356 |
- name: Setup Just |
| 357 |
uses: extractions/setup-just@53165ef7e734c5c07cb06b3c8e7b647c5aa16db3 |
| 358 |
- name: Run Unit Tests |
| 359 |
env: |
| 360 |
TEST_PYTHON: ${{ steps.sp.outputs.python-path }} |
| 361 |
run: | |
| 362 |
just test-all --group "$TEST_DATABASE_CLIENT_VERSION" -p "$TEST_PYTHON" --group "$TEST_DJANGO_VERSION" |
| 363 |
- name: Store coverage files |
| 364 |
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a |
| 365 |
with: |
| 366 |
name: ${{ env.COVERAGE_FILE }} |
| 367 |
path: ${{ env.COVERAGE_FILE }} |
| 368 |
|
| 369 |
mariadb: |
| 370 |
runs-on: ubuntu-latest |
| 371 |
permissions: |
| 372 |
contents: read |
| 373 |
env: |
| 374 |
RDBMS: mariadb |
| 375 |
COVERAGE_FILE: linux-py${{ matrix.python-version }}-${{ matrix.django-version }}-${{ matrix.mysqlclient-version }}-mariadb${{ matrix.mariadb-version }}.coverage |
| 376 |
TEST_PYTHON_VERSION: ${{ matrix.python-version }} |
| 377 |
TEST_DJANGO_VERSION: ${{ matrix.django-version }} |
| 378 |
TEST_DATABASE_CLIENT_VERSION: ${{ matrix.mysqlclient-version }} |
| 379 |
TEST_DATABASE_VERSION: ${{ matrix.mariadb-version }} |
| 380 |
|
| 381 |
strategy: |
| 382 |
fail-fast: false |
| 383 |
matrix: |
| 384 |
python-version: ["3.10", "3.12", "3.14"] |
| 385 |
mysqlclient-version: ["mysqlclient14", "mysqlclient2x"] |
| 386 |
mariadb-version: ["10.4", "latest"] |
| 387 |
mariadb-healthcheck: |
| 388 |
["mysqladmin ping", "healthcheck.sh --connect --innodb_initialized"] |
| 389 |
django-version: |
| 390 |
- "dj42" # LTS April 2024 |
| 391 |
- "dj52" # LTS April 2028 |
| 392 |
- "dj61" # |
| 393 |
exclude: |
| 394 |
- django-version: "dj42" |
| 395 |
mariadb-version: "latest" |
| 396 |
|
| 397 |
- django-version: "dj52" |
| 398 |
mariadb-version: "10.4" |
| 399 |
- django-version: "dj61" |
| 400 |
mariadb-version: "10.4" |
| 401 |
|
| 402 |
- mariadb-version: "latest" |
| 403 |
mysqlclient-version: "mysqlclient14" |
| 404 |
|
| 405 |
- python-version: "3.12" |
| 406 |
django-version: "dj42" |
| 407 |
- python-version: "3.14" |
| 408 |
django-version: "dj42" |
| 409 |
|
| 410 |
- python-version: "3.10" |
| 411 |
django-version: "dj52" |
| 412 |
- python-version: "3.14" |
| 413 |
django-version: "dj52" |
| 414 |
- django-version: "dj52" |
| 415 |
mysqlclient-version: "mysqlclient14" |
| 416 |
|
| 417 |
- python-version: "3.10" |
| 418 |
django-version: "dj61" |
| 419 |
- python-version: "3.12" |
| 420 |
django-version: "dj61" |
| 421 |
|
| 422 |
- mariadb-version: "10.4" |
| 423 |
mysqlclient-version: "mysqlclient2x" |
| 424 |
|
| 425 |
- mariadb-version: "latest" |
| 426 |
mariadb-healthcheck: "mysqladmin ping" |
| 427 |
- mariadb-version: "10.4" |
| 428 |
mariadb-healthcheck: "healthcheck.sh --connect --innodb_initialized" |
| 429 |
|
| 430 |
# pin each image to its digest (satisfies zizmor unpinned-images) |
| 431 |
# while keeping mariadb-version driving the matrix |
| 432 |
include: |
| 433 |
- mariadb-version: "10.4" |
| 434 |
mariadb-image: "mariadb:10.4@sha256:22edfe1c78349f8cae88bbb5c2873b7e6c515be767c91c691308ce57445806f3" |
| 435 |
- mariadb-version: "latest" |
| 436 |
mariadb-image: "mariadb:latest@sha256:6a4c4bbf0447c2247801309513fcc0dd17c3f35390368139ce419387fdd1144d" |
| 437 |
|
| 438 |
services: |
| 439 |
mariadb: |
| 440 |
# Docker Hub image |
| 441 |
image: ${{ matrix.mariadb-image }} |
| 442 |
# Provide the password for mysql |
| 443 |
env: |
| 444 |
MYSQL_ROOT_PASSWORD: root |
| 445 |
MYSQL_MULTIPLE_DATABASES: test1,test2 |
| 446 |
# Set health checks to wait until mysql has started |
| 447 |
options: >- |
| 448 |
--health-cmd="${{ matrix.mariadb-healthcheck }}" |
| 449 |
--health-interval 10s |
| 450 |
--health-timeout 5s |
| 451 |
--health-retries 5 |
| 452 |
ports: |
| 453 |
# Maps tcp port 3306 on service container to the host |
| 454 |
- 3306:3306 |
| 455 |
|
| 456 |
steps: |
| 457 |
# make text comparisons case sensitive (some tests) |
| 458 |
- name: Set default collation for MariaDB |
| 459 |
run: | |
| 460 |
mysql -h 127.0.0.1 -u root -proot <<EOF |
| 461 |
SET GLOBAL character_set_server='utf8mb4'; |
| 462 |
SET GLOBAL collation_server='utf8mb4_bin'; |
| 463 |
EOF |
| 464 |
- name: Clear Tool cache |
| 465 |
if: ${{ github.event.inputs.clear_cache == 'true' }} |
| 466 |
run: sudo rm -rf /opt/hostedtoolcache |
| 467 |
- uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 |
| 468 |
with: |
| 469 |
persist-credentials: false |
| 470 |
- name: Set up Python ${{ matrix.python-version }} |
| 471 |
uses: actions/setup-python@ece7cb06caefa5fff74198d8649806c4678c61a1 |
| 472 |
id: sp |
| 473 |
with: |
| 474 |
python-version: ${{ matrix.python-version }} |
| 475 |
allow-prereleases: true |
| 476 |
- name: Install Emacs |
| 477 |
if: ${{ github.event.inputs.debug == 'true' }} |
| 478 |
run: | |
| 479 |
sudo apt install emacs |
| 480 |
- name: Setup tmate session |
| 481 |
if: ${{ github.event.inputs.debug == 'true' }} |
| 482 |
uses: mxschmitt/action-tmate@35b54afac29c97fb54faba5b513f8fbd1882f113 |
| 483 |
timeout-minutes: 60 |
| 484 |
- name: Install uv |
| 485 |
uses: astral-sh/setup-uv@fac544c07dec837d0ccb6301d7b5580bf5edae39 |
| 486 |
with: |
| 487 |
enable-cache: false |
| 488 |
- name: Setup Just |
| 489 |
uses: extractions/setup-just@53165ef7e734c5c07cb06b3c8e7b647c5aa16db3 |
| 490 |
- name: Run Unit Tests |
| 491 |
env: |
| 492 |
TEST_PYTHON: ${{ steps.sp.outputs.python-path }} |
| 493 |
run: | |
| 494 |
just test-all --group "$TEST_DATABASE_CLIENT_VERSION" -p "$TEST_PYTHON" --group "$TEST_DJANGO_VERSION" |
| 495 |
- name: Store coverage files |
| 496 |
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a |
| 497 |
with: |
| 498 |
name: ${{ env.COVERAGE_FILE }} |
| 499 |
path: ${{ env.COVERAGE_FILE }} |
| 500 |
|
| 501 |
oracle: |
| 502 |
runs-on: ubuntu-latest |
| 503 |
permissions: |
| 504 |
contents: read |
| 505 |
env: |
| 506 |
RDBMS: oracle |
| 507 |
TEST_PYTHON_VERSION: ${{ matrix.python-version }} |
| 508 |
TEST_DJANGO_VERSION: ${{ matrix.django-version }} |
| 509 |
TEST_DATABASE_VERSION: ${{ matrix.oracle-version }} |
| 510 |
strategy: |
| 511 |
fail-fast: false |
| 512 |
matrix: |
| 513 |
python-version: ["3.10", "3.14"] |
| 514 |
django-version: |
| 515 |
- "dj42" # LTS April 2026 |
| 516 |
- "dj52" # LTS April 2028 |
| 517 |
- "dj61" # |
| 518 |
oracle-version: |
| 519 |
- "oracle-xe:21" |
| 520 |
- "oracle-free:latest" |
| 521 |
exclude: |
| 522 |
- django-version: "dj42" |
| 523 |
oracle-version: "oracle-free:latest" |
| 524 |
|
| 525 |
- django-version: "dj52" |
| 526 |
oracle-version: "oracle-free:latest" |
| 527 |
|
| 528 |
- django-version: "dj61" |
| 529 |
oracle-version: "oracle-xe:21" |
| 530 |
|
| 531 |
- python-version: "3.10" |
| 532 |
django-version: "dj61" |
| 533 |
|
| 534 |
- python-version: "3.14" |
| 535 |
django-version: "dj42" |
| 536 |
- python-version: "3.14" |
| 537 |
django-version: "dj52" |
| 538 |
|
| 539 |
# pin each image to its digest (satisfies zizmor unpinned-images) |
| 540 |
# while keeping oracle-version driving the matrix |
| 541 |
include: |
| 542 |
- oracle-version: "oracle-xe:21" |
| 543 |
oracle-image: "gvenzl/oracle-xe:21@sha256:c2682a4216b0fe65537912c4a049c7e5c15a85bb7c94bb8137d5f2d2eef60603" |
| 544 |
- oracle-version: "oracle-free:latest" |
| 545 |
oracle-image: "gvenzl/oracle-free:latest@sha256:e2763af84ecc345d48e4e3fe7999d0b7bb57885b6e0166051acd5f62e27eb605" |
| 546 |
|
| 547 |
services: |
| 548 |
oracle1: |
| 549 |
image: ${{ matrix.oracle-image }} |
| 550 |
env: |
| 551 |
ORACLE_PASSWORD: password |
| 552 |
ORACLE_DATABASE: test1 |
| 553 |
# Forward Oracle port |
| 554 |
ports: |
| 555 |
- 1521:1521 |
| 556 |
# Provide healthcheck script options for startup |
| 557 |
options: >- |
| 558 |
--health-cmd healthcheck.sh |
| 559 |
--health-interval 10s |
| 560 |
--health-timeout 5s |
| 561 |
--health-retries 10 |
| 562 |
|
| 563 |
oracle2: |
| 564 |
image: ${{ matrix.oracle-image }} |
| 565 |
env: |
| 566 |
ORACLE_PASSWORD: password |
| 567 |
ORACLE_DATABASE: test2 |
| 568 |
# Forward Oracle port |
| 569 |
ports: |
| 570 |
- 1522:1521 |
| 571 |
# Provide healthcheck script options for startup |
| 572 |
options: >- |
| 573 |
--health-cmd healthcheck.sh |
| 574 |
--health-interval 10s |
| 575 |
--health-timeout 5s |
| 576 |
--health-retries 10 |
| 577 |
|
| 578 |
steps: |
| 579 |
- name: Set coverage file |
| 580 |
run: | |
| 581 |
ORACLE_TAG=$(echo "$TEST_DATABASE_VERSION" | cut -d':' -f2) |
| 582 |
echo "COVERAGE_FILE=linux-py${TEST_PYTHON_VERSION}-${TEST_DJANGO_VERSION}-oracle${ORACLE_TAG}.coverage" >> $GITHUB_ENV |
| 583 |
- name: Clear Tool cache |
| 584 |
if: ${{ github.event.inputs.clear_cache == 'true' }} |
| 585 |
run: sudo rm -rf /opt/hostedtoolcache |
| 586 |
- uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 |
| 587 |
with: |
| 588 |
persist-credentials: false |
| 589 |
- name: Set up Python ${{ matrix.python-version }} |
| 590 |
id: sp |
| 591 |
uses: actions/setup-python@ece7cb06caefa5fff74198d8649806c4678c61a1 |
| 592 |
with: |
| 593 |
python-version: ${{ matrix.python-version }} |
| 594 |
allow-prereleases: true |
| 595 |
- name: Install Emacs |
| 596 |
if: ${{ github.event.inputs.debug == 'true' }} |
| 597 |
run: | |
| 598 |
sudo apt install emacs |
| 599 |
- name: Setup tmate session |
| 600 |
if: ${{ github.event.inputs.debug == 'true' }} |
| 601 |
uses: mxschmitt/action-tmate@35b54afac29c97fb54faba5b513f8fbd1882f113 |
| 602 |
timeout-minutes: 60 |
| 603 |
- name: Install uv |
| 604 |
uses: astral-sh/setup-uv@fac544c07dec837d0ccb6301d7b5580bf5edae39 |
| 605 |
with: |
| 606 |
enable-cache: false |
| 607 |
- name: Setup Just |
| 608 |
uses: extractions/setup-just@53165ef7e734c5c07cb06b3c8e7b647c5aa16db3 |
| 609 |
- name: Install Oracle Client |
| 610 |
# https://askubuntu.com/questions/1512196/libaio1-on-noble |
| 611 |
run: | |
| 612 |
sudo apt install alien libaio1t64 |
| 613 |
sudo ln -s /usr/lib/x86_64-linux-gnu/libaio.so.1t64 /usr/lib/x86_64-linux-gnu/libaio.so.1 |
| 614 |
if [[ "$TEST_DATABASE_VERSION" == oracle-xe* ]]; then |
| 615 |
curl --output oracle-client.rpm https://download.oracle.com/otn_software/linux/instantclient/2116000/oracle-instantclient-basiclite-21.16.0.0.0-1.el8.x86_64.rpm |
| 616 |
sudo alien -i oracle-client.rpm |
| 617 |
sudo sh -c "echo /usr/lib/oracle/21/client64/lib/ > /etc/ld.so.conf.d/oracle.conf" |
| 618 |
else |
| 619 |
curl --output oracle-client.rpm https://download.oracle.com/otn_software/linux/instantclient/2326000/oracle-instantclient-basiclite-23.26.0.0.0-1.el9.x86_64.rpm |
| 620 |
sudo alien -i oracle-client.rpm |
| 621 |
sudo sh -c "echo /usr/lib/oracle/23/client64/lib/ > /etc/ld.so.conf.d/oracle.conf" |
| 622 |
fi |
| 623 |
sudo ldconfig |
| 624 |
# we don't run integration tests against Oracle in CI, these are slow enough |
| 625 |
- name: Run Full Unit Tests |
| 626 |
env: |
| 627 |
TEST_PYTHON: ${{ steps.sp.outputs.python-path }} |
| 628 |
run: | |
| 629 |
if [[ "$TEST_DATABASE_VERSION" == oracle-xe* ]]; then |
| 630 |
just test-all --group cx_oracle -p "$TEST_PYTHON" --group "$TEST_DJANGO_VERSION" |
| 631 |
else |
| 632 |
just test-all --group oracledb -p "$TEST_PYTHON" --group "$TEST_DJANGO_VERSION" |
| 633 |
fi |
| 634 |
|
| 635 |
- name: Store coverage files |
| 636 |
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a |
| 637 |
with: |
| 638 |
name: ${{ env.COVERAGE_FILE }} |
| 639 |
path: ${{ env.COVERAGE_FILE }} |
| 640 |
|
| 641 |
windows: |
| 642 |
runs-on: windows-latest |
| 643 |
permissions: |
| 644 |
contents: read |
| 645 |
env: |
| 646 |
RDBMS: sqlite |
| 647 |
COVERAGE_FILE: windows-py${{ matrix.python-version }}-${{ matrix.django-version }}-sqlite.coverage |
| 648 |
TEST_PYTHON_VERSION: ${{ matrix.python-version }} |
| 649 |
TEST_DJANGO_VERSION: ${{ matrix.django-version }} |
| 650 |
TEST_DATABASE_VERSION: "sqlite" |
| 651 |
strategy: |
| 652 |
fail-fast: false |
| 653 |
matrix: |
| 654 |
python-version: ["3.10", "3.12", "3.14"] |
| 655 |
django-version: |
| 656 |
- "dj42" # LTS April 2026 |
| 657 |
- "dj52" # LTS April 2028 |
| 658 |
- "dj61" # |
| 659 |
exclude: |
| 660 |
- python-version: "3.10" |
| 661 |
django-version: "dj52" |
| 662 |
- python-version: "3.10" |
| 663 |
django-version: "dj61" |
| 664 |
|
| 665 |
- python-version: "3.12" |
| 666 |
django-version: "dj42" |
| 667 |
- python-version: "3.12" |
| 668 |
django-version: "dj61" |
| 669 |
|
| 670 |
- python-version: "3.14" |
| 671 |
django-version: "dj42" |
| 672 |
- python-version: "3.14" |
| 673 |
django-version: "dj52" |
| 674 |
|
| 675 |
steps: |
| 676 |
- uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 |
| 677 |
with: |
| 678 |
persist-credentials: false |
| 679 |
- name: Set up Python ${{ matrix.python-version }} |
| 680 |
uses: actions/setup-python@ece7cb06caefa5fff74198d8649806c4678c61a1 |
| 681 |
id: sp |
| 682 |
with: |
| 683 |
python-version: ${{ matrix.python-version }} |
| 684 |
allow-prereleases: true |
| 685 |
- name: Install uv |
| 686 |
uses: astral-sh/setup-uv@fac544c07dec837d0ccb6301d7b5580bf5edae39 |
| 687 |
with: |
| 688 |
enable-cache: false |
| 689 |
- name: Setup Just |
| 690 |
uses: extractions/setup-just@53165ef7e734c5c07cb06b3c8e7b647c5aa16db3 |
| 691 |
- name: install-vim-windows |
| 692 |
if: ${{ github.event.inputs.debug == 'true' }} |
| 693 |
uses: rhysd/action-setup-vim@febef33995d6649302e9d88dda81e071b68f16a7 |
| 694 |
- name: Setup tmate session |
| 695 |
if: ${{ github.event.inputs.debug == 'true' }} |
| 696 |
uses: mxschmitt/action-tmate@35b54afac29c97fb54faba5b513f8fbd1882f113 |
| 697 |
timeout-minutes: 60 |
| 698 |
- name: Run Unit Tests |
| 699 |
env: |
| 700 |
TEST_PYTHON: ${{ steps.sp.outputs.python-path }} |
| 701 |
run: | |
| 702 |
just test-all -p "$env:TEST_PYTHON" --group "$env:TEST_DJANGO_VERSION" |
| 703 |
shell: pwsh |
| 704 |
- name: Store coverage files |
| 705 |
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a |
| 706 |
with: |
| 707 |
name: ${{ env.COVERAGE_FILE }} |
| 708 |
path: ${{ env.COVERAGE_FILE }} |
| 709 |
|
| 710 |
macos: |
| 711 |
runs-on: macos-latest |
| 712 |
permissions: |
| 713 |
contents: read |
| 714 |
env: |
| 715 |
RDBMS: sqlite |
| 716 |
COVERAGE_FILE: macos-py${{ matrix.python-version }}-${{ matrix.django-version }}-sqlite.coverage |
| 717 |
TEST_PYTHON_VERSION: ${{ matrix.python-version }} |
| 718 |
TEST_DJANGO_VERSION: ${{ matrix.django-version }} |
| 719 |
TEST_DATABASE_VERSION: "sqlite" |
| 720 |
strategy: |
| 721 |
fail-fast: false |
| 722 |
matrix: |
| 723 |
python-version: ["3.10", "3.12", "3.14"] |
| 724 |
django-version: |
| 725 |
- "dj42" # LTS April 2024 |
| 726 |
- "dj52" # LTS April 2028 |
| 727 |
- "dj61" # |
| 728 |
exclude: |
| 729 |
- python-version: "3.10" |
| 730 |
django-version: "dj52" |
| 731 |
- python-version: "3.10" |
| 732 |
django-version: "dj61" |
| 733 |
|
| 734 |
- python-version: "3.12" |
| 735 |
django-version: "dj42" |
| 736 |
- python-version: "3.12" |
| 737 |
django-version: "dj61" |
| 738 |
|
| 739 |
- python-version: "3.14" |
| 740 |
django-version: "dj42" |
| 741 |
- python-version: "3.14" |
| 742 |
django-version: "dj52" |
| 743 |
|
| 744 |
steps: |
| 745 |
- name: Clear Tool cache |
| 746 |
if: ${{ github.event.inputs.clear_cache == 'true' }} |
| 747 |
run: sudo rm -rf /opt/hostedtoolcache |
| 748 |
- uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 |
| 749 |
with: |
| 750 |
persist-credentials: false |
| 751 |
- name: Set up Python ${{ matrix.python-version }} |
| 752 |
uses: actions/setup-python@ece7cb06caefa5fff74198d8649806c4678c61a1 |
| 753 |
id: sp |
| 754 |
with: |
| 755 |
python-version: ${{ matrix.python-version }} |
| 756 |
allow-prereleases: true |
| 757 |
- name: Install uv |
| 758 |
uses: astral-sh/setup-uv@fac544c07dec837d0ccb6301d7b5580bf5edae39 |
| 759 |
with: |
| 760 |
enable-cache: false |
| 761 |
- name: Setup Just |
| 762 |
uses: extractions/setup-just@53165ef7e734c5c07cb06b3c8e7b647c5aa16db3 |
| 763 |
- name: install-emacs-macos |
| 764 |
if: ${{ github.event.inputs.debug == 'true' }} |
| 765 |
run: | |
| 766 |
brew install emacs |
| 767 |
- name: Setup tmate session |
| 768 |
if: ${{ github.event.inputs.debug == 'true' }} |
| 769 |
uses: mxschmitt/action-tmate@35b54afac29c97fb54faba5b513f8fbd1882f113 |
| 770 |
timeout-minutes: 60 |
| 771 |
- name: Run Unit Tests |
| 772 |
env: |
| 773 |
TEST_PYTHON: ${{ steps.sp.outputs.python-path }} |
| 774 |
run: | |
| 775 |
just test-all -p "$TEST_PYTHON" --group "$TEST_DJANGO_VERSION" |
| 776 |
- name: Store coverage files |
| 777 |
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a |
| 778 |
with: |
| 779 |
name: ${{ env.COVERAGE_FILE }} |
| 780 |
path: ${{ env.COVERAGE_FILE }} |
| 781 |
|
| 782 |
coverage-combine: |
| 783 |
needs: [postgres, sqlite, mysql, mariadb, oracle, windows, macos] |
| 784 |
runs-on: ubuntu-latest |
| 785 |
permissions: |
| 786 |
contents: read |
| 787 |
id-token: write # for codecov oidc authentication |
| 788 |
steps: |
| 789 |
- uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 |
| 790 |
with: |
| 791 |
persist-credentials: false |
| 792 |
- uses: actions/setup-python@ece7cb06caefa5fff74198d8649806c4678c61a1 |
| 793 |
id: sp |
| 794 |
with: |
| 795 |
python-version: "3.12" |
| 796 |
- name: Install uv |
| 797 |
uses: astral-sh/setup-uv@fac544c07dec837d0ccb6301d7b5580bf5edae39 |
| 798 |
with: |
| 799 |
enable-cache: false |
| 800 |
- name: Setup Just |
| 801 |
uses: extractions/setup-just@53165ef7e734c5c07cb06b3c8e7b647c5aa16db3 |
| 802 |
- name: Get coverage files |
| 803 |
uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c |
| 804 |
with: |
| 805 |
pattern: "*.coverage" |
| 806 |
merge-multiple: true |
| 807 |
- run: ls -la *.coverage |
| 808 |
- run: just coverage |
| 809 |
|
| 810 |
- name: Upload coverage to Codecov |
| 811 |
uses: codecov/codecov-action@fb8b3582c8e4def4969c97caa2f19720cb33a72f |
| 812 |
with: |
| 813 |
use_oidc: true |
| 814 |
files: ./coverage.xml |