diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index caddc478a0..b8b211587f 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -59,6 +59,10 @@ jobs: pip install --upgrade pip pip install -r requirements/local.txt + - name: Check for missing migrations + run: | + python manage.py makemigrations --check --dry-run --noinput + - name: Configure environment run: | echo "JWKS_BASE64=$(python manage.py generate_jwks)" >> $GITHUB_ENV diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index b4561b2650..2ae91d5641 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -34,3 +34,13 @@ repos: - id: flake8 args: ["--config=.flake8"] additional_dependencies: [flake8-isort] + + - repo: local + hooks: + - id: django-migrations-check + name: check django migrations + language: system + entry: .venv/bin/python manage.py makemigrations --dry-run --check --noinput + pass_filenames: false + exclude: migrations + types: [python]