Skip to content

Commit

Permalink
create check-migrations workflow (#3140)
Browse files Browse the repository at this point in the history
  • Loading branch information
maskarb authored Sep 14, 2021
1 parent e3f6cb2 commit 89166a7
Show file tree
Hide file tree
Showing 6 changed files with 33 additions and 6 deletions.
15 changes: 15 additions & 0 deletions .github/scripts/check_migrations.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
#!/bin/bash

set -e

pipenv run make make-migrations

changed=`git add -N . && git diff --name-only HEAD`

if [[ $changed == *"migration"* ]]; then
echo "Migrations are out of sync with the models. Run 'make make-migrations' to update."
exit 1
else
echo "Migrations are in sync."
exit 0
fi
4 changes: 2 additions & 2 deletions .github/workflows/check-clowdapp.yml
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
name: ClowdApp check
name: Check Clowdapp

on:
pull_request:
branches:
- main

jobs:
clowdapp-check:
check-clowdapp:
runs-on: ubuntu-latest

steps:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/check-manifest.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Check manifest
name: Check Manifest

on:
pull_request:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/pre-commit.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: pre-commit
name: Linting and Formatting

on:
pull_request:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/pre-release.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: pre release
name: Create Pre-Release

on:
workflow_dispatch:
Expand Down
14 changes: 13 additions & 1 deletion .github/workflows/unittests.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Unit Tests
name: Check Migrations and Run Unit Tests

on:
pull_request:
Expand Down Expand Up @@ -63,6 +63,18 @@ jobs:
run: |
pipenv install --dev --ignore-pipfile --python ${{ matrix.python-version }}
- name: Check migrations
run: bash .github/scripts/check_migrations.sh
env:
DATABASE_SERVICE_NAME: POSTGRES_SQL
DATABASE_ENGINE: postgresql
DATABASE_NAME: postgres
DATABASE_USER: postgres
DATABASE_PASSWORD: postgres
POSTGRES_SQL_SERVICE_HOST: localhost
POSTGRES_SQL_SERVICE_PORT: ${{ job.services.postgres.ports[5432] }}
prometheus_multiproc_dir: /tmp

- name: Run unit tests
run: pipenv run coverage run ./koku/manage.py test --noinput --verbosity 2 ./koku/
env:
Expand Down

0 comments on commit 89166a7

Please sign in to comment.