Skip to content

Django/Python version upgrades #185

Django/Python version upgrades

Django/Python version upgrades #185

Workflow file for this run

name: tests
on:
push:
branches: [main]
pull_request:
branches: [main]
jobs:
tests:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
python: ['3.9', '3.10', '3.11', '3.12']
django: ['django==3.2.*', 'django==4.2.*', 'django==5.2.*']
experimental: [false]
exclude:
- python: '3.9'
django: 'django==5.2.*'
include:
- python: '3.12'
django: 'django==6.0.*'
experimental: true
# NOTE this job will appear to pass even when it fails because of
# `continue-on-error: true`. Github Actions apparently does not
# have this feature, similar to Travis' allow-failure, yet.
# https://github.com/actions/toolkit/issues/399
services:
postgres:
image: postgres:latest
env:
POSTGRES_DB: postgres
POSTGRES_PASSWORD: postgres
POSTGRES_USER: postgres
ports:
- 5432:5432
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
steps:
- uses: actions/checkout@v4
- uses: astral-sh/setup-uv@v6
with:
version: '>=0.7'
python-version: ${{ matrix.python }}
- name: Setup
run: |
uv sync --locked --dev --no-install-package=django
uv pip install "${{ matrix.django }}" psycopg2-binary
- name: Run tests
env:
DB_SETTINGS: >-
{
"ENGINE":"django.db.backends.postgresql_psycopg2",
"NAME":"field_audit",
"USER":"postgres",
"PASSWORD":"postgres",
"HOST":"localhost",
"PORT":"5432"
}
run: uv run pytest --cov=field_audit --cov-branch -v
continue-on-error: ${{ matrix.experimental }}
- name: Check migrations
run: |
uv run ./example/manage.py makemigrations field_audit
git add ./field_audit/migrations
trap 'git reset --hard HEAD' EXIT # discard changes on exit (needed for continue-on-error)
git diff --cached --exit-code
continue-on-error: ${{ matrix.experimental }}
- name: Check style
run: uv run ruff check