Skip to content

Add missing migration & CI check for forgotten migrations #5

Add missing migration & CI check for forgotten migrations

Add missing migration & CI check for forgotten migrations #5

name: Make sure to run manage.py makemigrations if you change models
on: [pull_request]
jobs:
is-migration-diff-clean:
runs-on: ubuntu-latest
services:
postgres:
image: postgres:latest
env:
POSTGRES_DB: nycmesh-dev
POSTGRES_USER: nycmesh
POSTGRES_PASSWORD: abcd1234
POSTGRES_PORT: 5432
ports:
- 5432:5432
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
steps:
- uses: actions/checkout@v3
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: '3.11'
- name: "Upgrade pip"
run: "pip install --upgrade pip"
- name: "Install package"
run: pip install ".[dev]"
- name: "You forgot to run manage.py makemigrations for model changes"
run: |
python src/manage.py makemigrations --dry-run # Run extra time for debug output
python src/manage.py makemigrations --dry-run | grep 'No changes detected'