summaryrefslogtreecommitdiff
path: root/.github
diff options
context:
space:
mode:
authorSkyiesac <jainsachi1202@gmail.com>2026-01-19 12:45:29 -0500
committerJacob Walls <jacobtylerwalls@gmail.com>2026-01-20 10:40:53 -0500
commite5cbb8b4be04797deedc775a5143b5035e7dd3b7 (patch)
treeb65f9a951669e77da04dce1f373cabd0490f1f08 /.github
parent748c2ba8370c66b098bd78b241c70d16712d1e93 (diff)
Fixed #36639 -- Added CI step to run makemigrations --check against test models.
Diffstat (limited to '.github')
-rw-r--r--.github/workflows/check-migrations.yml68
1 files changed, 68 insertions, 0 deletions
diff --git a/.github/workflows/check-migrations.yml b/.github/workflows/check-migrations.yml
new file mode 100644
index 0000000000..8b29b2bb34
--- /dev/null
+++ b/.github/workflows/check-migrations.yml
@@ -0,0 +1,68 @@
+name: Check migrations
+
+on:
+ pull_request:
+ paths:
+ - 'tests/**/models.py'
+ - 'tests/**/migrations/**'
+ - 'tests/**/*migrations/**/*.py'
+ - 'scripts/check_migrations.py'
+ push:
+ branches:
+ - main
+
+concurrency:
+ group: ${{ github.workflow }}-${{ github.ref }}
+ cancel-in-progress: true
+
+permissions:
+ contents: read
+
+jobs:
+ check-migrations:
+ name: Check test migrations
+ runs-on: ubuntu-latest
+ timeout-minutes: 60
+
+ services:
+ postgres:
+ image: postgres:15-alpine
+ env:
+ POSTGRES_DB: django
+ POSTGRES_USER: user
+ POSTGRES_PASSWORD: postgres
+ ports:
+ - 5432:5432
+ options: >-
+ --health-cmd pg_isready
+ --health-interval 10s
+ --health-timeout 5s
+ --health-retries 5
+
+ steps:
+ - name: Checkout
+ uses: actions/checkout@v6
+ with:
+ persist-credentials: false
+
+ - name: Set up Python
+ uses: actions/setup-python@v6
+ with:
+ python-version: '3.14'
+ cache: 'pip'
+ cache-dependency-path: 'tests/requirements/py3.txt'
+
+ - name: Install dependencies
+ run: |
+ python -m pip install --upgrade pip wheel
+ python -m pip install -e . psycopg[binary]
+
+ - name: Create PostgreSQL settings file
+ run: mv ./.github/workflows/data/test_postgres.py.tpl ./tests/test_postgres.py
+
+ - name: Check for missing migrations
+ env:
+ DJANGO_SETTINGS_MODULE: test_postgres
+ PYTHONPATH: ${{ github.workspace }}/tests:${{ github.workspace }}
+ run: |
+ python scripts/check_migrations.py