Skip to content

Commit

Permalink
CI: Add test to ensure schema migrations are complete
Browse files Browse the repository at this point in the history
  • Loading branch information
erikd committed Feb 16, 2023
1 parent 63e68f2 commit 2824157
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion .github/workflows/haskell.yml
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ jobs:
- uses: actions/cache@v3
name: Cache cabal store
with:
path: |
path: |
${{ steps.setup-haskell.outputs.cabal-store }}
dist-newstyle
key: cache-cabal-store-v1-${{ runner.os }}-${{ matrix.ghc }}-${{ hashFiles('dependencies.txt') }}
Expand Down Expand Up @@ -144,3 +144,15 @@ jobs:
- name: Run tests
run: cabal test all -j1

- name: Check that Schema Migrations are complete
id: schema_check
run: |
PGPASSFILE=config/pgpass-mainnet cabal run cardano-db-tool -- run-migrations --mdir schema/ --ldir /tmp/
git diff schema/ > schema.diff
line_count="$(wc -l schema.diff)"
if test $(line_count} > 0 ; then
echo "Schema diff"
cat schema.diff
exit 1
fi

0 comments on commit 2824157

Please sign in to comment.