Skip to content

Commit

Permalink
Test cached binaries and use /usr/lib contents as cache key (#7875)
Browse files Browse the repository at this point in the history
This should make the build more reliable in the face of minor library updates on GH runners.
  • Loading branch information
mmastrac authored Oct 16, 2024
1 parent cd17c0c commit 6a9bb55
Show file tree
Hide file tree
Showing 8 changed files with 228 additions and 20 deletions.
23 changes: 21 additions & 2 deletions .github/workflows.src/tests.inc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@
id: postgres-cache
with:
path: build/postgres/install
key: edb-postgres-v3-${{ env.POSTGRES_GIT_REV }}
key: edb-postgres-v3-${{ env.POSTGRES_GIT_REV }}-${{ hashFiles('shared-artifacts/lib_cache_key.txt') }}

- name: Handle cached Stolon build
uses: actions/cache@v4
Expand Down Expand Up @@ -304,6 +304,11 @@

<% macro calc_cache_key() -%>
mkdir -p shared-artifacts
if [ "$(uname)" = "Darwin" ]; then
find /usr/lib -type f -name 'lib*' -exec stat -f '%N %z' {} + | sort | shasum -a 256 | cut -d ' ' -f1 > shared-artifacts/lib_cache_key.txt
else
find /usr/lib -type f -name 'lib*' -printf '%P %s\n' | sort | sha256sum | cut -d ' ' -f1 > shared-artifacts/lib_cache_key.txt
fi
python setup.py -q ci_helper --type cli > shared-artifacts/edgedbcli_git_rev.txt
python setup.py -q ci_helper --type rust >shared-artifacts/rust_cache_key.txt
python setup.py -q ci_helper --type ext >shared-artifacts/ext_cache_key.txt
Expand Down Expand Up @@ -386,7 +391,7 @@
id: postgres-cache
with:
path: build/postgres/install
key: edb-postgres-v3-${{ env.POSTGRES_GIT_REV }}
key: edb-postgres-v3-${{ env.POSTGRES_GIT_REV }}-${{ hashFiles('shared-artifacts/lib_cache_key.txt') }}

- name: Restore cached Stolon build
uses: actions/cache@v4
Expand Down Expand Up @@ -415,6 +420,20 @@
echo ::error::Cannot retrieve build cache.
exit 1
- name: Validate cached binaries
run: |
# Validate EdgeDB CLI
./build/cli/bin/edgedb --version || exit 1
# Validate Stolon
./build/stolon/bin/stolon-sentinel --version || exit 1
./build/stolon/bin/stolon-keeper --version || exit 1
./build/stolon/bin/stolon-proxy --version || exit 1
# Validate PostgreSQL
./build/postgres/install/bin/postgres --version || exit 1
./build/postgres/install/bin/pg_config --version || exit 1
- name: Restore cache into the source tree
run: |
cp -v build/cli/bin/edgedb edb/cli/edgedb
Expand Down
23 changes: 21 additions & 2 deletions .github/workflows/tests-ha.yml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

23 changes: 21 additions & 2 deletions .github/workflows/tests-inplace.yml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

87 changes: 81 additions & 6 deletions .github/workflows/tests-managed-pg.yml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

23 changes: 21 additions & 2 deletions .github/workflows/tests-patches.yml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 6a9bb55

Please sign in to comment.