Skip to content

Commit d58eefe

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

File tree

2 files changed

+16
-4
lines changed

2 files changed

+16
-4
lines changed

.github/workflows/haskell.yml

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ jobs:
4040
- name: Install Postgres support (macOS)
4141
if: matrix.os == 'macos-latest'
4242
run: |
43-
brew install postgresql@14 libpq [email protected]
43+
brew install postgresql@14 libpq [email protected] pkg-config
4444
brew services start postgresql
4545
sudo mkdir -p /var/run/postgresql/
4646
sudo ln -s /tmp/.s.PGSQL.5432 /var/run/postgresql/.s.PGSQL.5432
@@ -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,14 @@ jobs:
144144
145145
- name: Run tests
146146
run: cabal test all -j1
147+
148+
- name: Check that Schema Migrations are complete
149+
run: |
150+
PGPASSFILE=config/pgpass-mainnet cabal run cardano-db-tool -- run-migrations --mdir schema/ --ldir /tmp/
151+
git diff schema/ > schema.diff
152+
line_count="$(wc -l schema.diff)"
153+
if test ${line_count} -ne 0 ; then
154+
echo "Schema diff"
155+
cat schema.diff
156+
exit 1
157+
fi

cabal.project

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,9 @@ repository cardano-haskell-packages
99
c00aae8461a256275598500ea0e187588c35a5d5d7454fb57eac18d9edb86a56
1010
d4a35cd3121aa00d18544bb0ac01c3e1691d618f462c46129271bccf39f7e8ee
1111

12-
index-state: 2022-11-11T00:00:00Z
13-
index-state: cardano-haskell-packages 2022-11-12T20:00:00Z
12+
index-state:
13+
, hackage.haskell.org 2022-11-11T00:00:00Z
14+
, cardano-haskell-packages 2022-11-12T20:00:00Z
1415

1516
packages:
1617
cardano-db

0 commit comments

Comments
 (0)