Skip to content

Commit

Permalink
Add check for Postgres revision
Browse files Browse the repository at this point in the history
  • Loading branch information
bayandin committed Jul 12, 2023
1 parent 7584470 commit 0b8f032
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 0 deletions.
20 changes: 20 additions & 0 deletions .github/workflows/build_and_test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -174,6 +174,26 @@ jobs:
submodules: true
fetch-depth: 1

- name: Check Postgres submodules revision
run: |
# This is a temporary solution to ensure that the Postgres submodules revision is correct (i.e. the updated intentionally).
# Eventually it will be replaced by a regression test https://github.com/neondatabase/neon/pull/4603
FAILED=false
for postgres in postgres-v14 postgres-v15; do
expected=$(cat vendor/revisions.json | jq --raw-output '."'"${postgres}"'"')
actual=$(git rev-parse "HEAD:vendor/${postgres}")
if [ "${expected}" != "${actual}" ]; then
echo >&2 "Expected ${postgres} rev to be at '${expected}', but it is at '${actual}'"
FAILED=true
fi
done
if [ "${FAILED}" = "true" ]; then
echo >&2 "Please update vendors/revisions.json if these changes are intentional"
exit 1
fi
- name: Set pg 14 revision for caching
id: pg_v14_rev
run: echo pg_rev=$(git rev-parse HEAD:vendor/postgres-v14) >> $GITHUB_OUTPUT
Expand Down
4 changes: 4 additions & 0 deletions vendor/revisions.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"postgres-v15": "1984832c740a7fa0e468bb720f40c525b652835d",
"postgres-v14": "1144aee1661c79eec65e784a8dad8bd450d9df79"
}

0 comments on commit 0b8f032

Please sign in to comment.