ci: add db migrations checks to tests and build workflows (#3920)

* ci: add db migrations checks to tests and build workflows

* ci: refactor migrations check expression

* chore: rework conditional and exit

Co-authored-by: Robert Sparks <rjsparks@nostrum.com>
This commit is contained in:
Nicolas Giard 2022-05-03 13:06:41 -04:00 committed by GitHub
parent 19796c56c9
commit f778058005
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 8 additions and 0 deletions

View file

@ -128,6 +128,10 @@ jobs:
run: |
echo "Running checks..."
./ietf/manage.py check
echo "Validating migrations..."
if ! (ietf/manage.py makemigrations 2>&1 | grep -q "^No changes detected$") ; then
echo -e "\nModel changes without migrations found." ; exit 1
fi
echo "Running tests..."
./ietf/manage.py test --settings=settings_sqlitetest
coverage xml

View file

@ -40,6 +40,10 @@ jobs:
run: |
echo "Running checks..."
./ietf/manage.py check
echo "Validating migrations..."
if ! (ietf/manage.py makemigrations 2>&1 | grep -q "^No changes detected$") ; then
echo -e "\nModel changes without migrations found." ; exit 1
fi
echo "Running tests..."
./ietf/manage.py test --settings=settings_sqlitetest
coverage xml