Skip to content

Commit f778058

Browse files
NGPixelrjsparks
andauthored
ci: add db migrations checks to tests and build workflows (ietf-tools#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>
1 parent 19796c5 commit f778058

2 files changed

Lines changed: 8 additions & 0 deletions

File tree

.github/workflows/build.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -128,6 +128,10 @@ jobs:
128128
run: |
129129
echo "Running checks..."
130130
./ietf/manage.py check
131+
echo "Validating migrations..."
132+
if ! (ietf/manage.py makemigrations 2>&1 | grep -q "^No changes detected$") ; then
133+
echo -e "\nModel changes without migrations found." ; exit 1
134+
fi
131135
echo "Running tests..."
132136
./ietf/manage.py test --settings=settings_sqlitetest
133137
coverage xml

.github/workflows/ci-run-tests.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,10 @@ jobs:
4040
run: |
4141
echo "Running checks..."
4242
./ietf/manage.py check
43+
echo "Validating migrations..."
44+
if ! (ietf/manage.py makemigrations 2>&1 | grep -q "^No changes detected$") ; then
45+
echo -e "\nModel changes without migrations found." ; exit 1
46+
fi
4347
echo "Running tests..."
4448
./ietf/manage.py test --settings=settings_sqlitetest
4549
coverage xml

0 commit comments

Comments
 (0)