Skip to content

Commit dfbfa86

Browse files
committed
CI: Add test to ensure schema migrations are complete
1 parent 63e68f2 commit dfbfa86

File tree

1 file changed

+13
-1
lines changed

1 file changed

+13
-1
lines changed

.github/workflows/haskell.yml

+13-1
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ jobs:
107107
- uses: actions/cache@v3
108108
name: Cache cabal store
109109
with:
110-
path: |
110+
path: |
111111
${{ steps.setup-haskell.outputs.cabal-store }}
112112
dist-newstyle
113113
key: cache-cabal-store-v1-${{ runner.os }}-${{ matrix.ghc }}-${{ hashFiles('dependencies.txt') }}
@@ -144,3 +144,15 @@ jobs:
144144
145145
- name: Run tests
146146
run: cabal test all -j1
147+
148+
- name: Check that Schema Migrations are complete
149+
id: schema_check
150+
run: |
151+
PGPASSFILE=config/pgpass-mainnet cabal run cardano-db-tool -- run-migrations --mdir schema/ --ldir /tmp/
152+
git diff schema/ > schema.diff
153+
line_count="$(wc -l schema.diff)"
154+
if test $(line_count} > 0 ; then
155+
echo "Schema diff"
156+
cat schema.diff
157+
exit 1
158+
fi

0 commit comments

Comments
 (0)