Skip to content

Commit

Permalink
Adds pre-commit hook and CI step in test to ensure no migrations are …
Browse files Browse the repository at this point in the history
…missing (#1509)

* update pre-commit to check pending migrations

* Add missing migration check in test CI

* add missing `--noinput`

---------

Co-authored-by: Vignesh Hari <[email protected]>
  • Loading branch information
rithviknishad and vigneshhari authored Aug 4, 2023
1 parent 6fa34f9 commit e337654
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 0 deletions.
4 changes: 4 additions & 0 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
10 changes: 10 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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]

0 comments on commit e337654

Please sign in to comment.