Skip to content

Commit 7075371

Browse files
committed
ci: add check that composite-schema.sql is up to date
1 parent 72c92ce commit 7075371

File tree

1 file changed

+25
-0
lines changed

1 file changed

+25
-0
lines changed
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
name: composite-schema
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
pull_request:
8+
9+
jobs:
10+
check:
11+
runs-on: ubuntu-latest
12+
steps:
13+
- uses: actions/checkout@v6
14+
- name: install compile-schema
15+
run: curl --proto '=https' --tlsv1.2 -LsSf https://github.com/wireapp/compile-schema/releases/latest/download/compile-schema-installer.sh | sh
16+
- name: check composite schema is up to date
17+
run: |
18+
generated=$(compile-schema keystore/src/connection/platform/generic/migrations)
19+
# -w ignores all whitespace differences; only non-whitespace diffs cause failure
20+
if diff -w <(echo "$generated") keystore/src/connection/platform/generic/composite-schema.sql > /dev/null; then
21+
echo "composite-schema.sql is up to date"
22+
else
23+
echo "::error file=keystore/src/connection/platform/generic/composite-schema.sql::composite-schema.sql is out of date. Please regenerate it using the compile-schema tool: https://github.com/wireapp/compile-schema"
24+
exit 1
25+
fi

0 commit comments

Comments
 (0)