Skip to content

Commit

Permalink
Make GitHub Actions CI cache checks also check for the metadata.
Browse files Browse the repository at this point in the history
  • Loading branch information
obi1kenobi committed Nov 30, 2024
1 parent 6227066 commit 6fe7a8b
Showing 1 changed file with 25 additions and 9 deletions.
34 changes: 25 additions & 9 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -406,11 +406,17 @@ jobs:
# Show what's in the cache.
ls subject-new/target/semver-checks/cache/
EXPECTED_CACHED_RUSTDOC='subject-new/target/semver-checks/cache/libp2p_core-0_37_0-ccce455725cbab73.json'
EXPECTED_PREFIX='subject-new/target/semver-checks/cache/libp2p_core-0_37_0-ccce455725cbab73'
EXPECTED_CACHED_METADATA="${EXPECTED_PREFIX}.metadata.json"
EXPECTED_CACHED_RUSTDOC="${EXPECTED_PREFIX}.json"
# Ensure the previous cached rustdoc file still exists.
# Ensure the previous cached rustdoc and metadata files still exist.
[ -f "$EXPECTED_CACHED_METADATA" ] || { \
echo "could not find libp2p-core metadata cache file"; \
exit 1;
}
[ -f "$EXPECTED_CACHED_RUSTDOC" ] || { \
echo "could not find libp2p-core cache file"; \
echo "could not find libp2p-core rustdoc cache file"; \
exit 1;
}
Expand Down Expand Up @@ -527,20 +533,30 @@ jobs:
ls subject/target/semver-checks/cache/
# The previous cached rustdoc should continue to exist.
if [ -f subject/target/semver-checks/cache/serde-1_0_162-5900ebf8bb9b9f8b.json ]; then
exit 0
else
PREVIOUS_PREFIX='subject/target/semver-checks/cache/serde-1_0_162-5900ebf8bb9b9f8b'
PREVIOUS_RUSTDOC="${PREVIOUS_PREFIX}.json"
PREVIOUS_METADATA="${PREVIOUS_PREFIX}.metadata.json"
if [ ! -f "$PREVIOUS_RUSTDOC" ]; then
echo "Older rustdoc JSON not found in cache!"
exit 1
fi
if [ ! -f "$PREVIOUS_METADATA" ]; then
echo "Older metadata file not found in cache!"
exit 1
fi
# There should also be a new cached rustdoc file for the new feature settings.
if [ -f subject/target/semver-checks/cache/serde-1_0_162-6999ae87ca463ab3.json ]; then
exit 0
else
NEW_PREFIX='subject/target/semver-checks/cache/serde-1_0_162-6999ae87ca463ab3'
NEW_RUSTDOC="${NEW_PREFIX}.json"
NEW_METADATA="${NEW_PREFIX}.metadata.json"
if [ ! -f "$NEW_RUSTDOC" ]; then
echo "New rustdoc JSON for new feature combo not found in cache!"
exit 1
fi
if [ ! -f "$NEW_METADATA" ]; then
echo "New metadata file for new feature combo not found in cache!"
exit 1
fi
- name: Cleanup
run: |
Expand Down

0 comments on commit 6fe7a8b

Please sign in to comment.