Skip to content

Commit bedf018

Browse files
mballanceCopilot
andcommitted
fix: add 'GHA cache backend activated' note; fix CI second-run check
The ivpm-cache repo has only PyPI packages (Cacheable: 0), so no per-package 'Restored' messages ever appear in the GHA CI job. * Add note() to GHACacheBackend.activate() so the backend prints a visible confirmation that it was selected and started. * Update CI second-run (and first-run) check to grep for that message instead of the package-restore message. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
1 parent b334d6f commit bedf018

File tree

2 files changed

+6
-3
lines changed

2 files changed

+6
-3
lines changed

.github/workflows/ci.yml

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,8 @@ jobs:
8484
export PYTHONPATH=$(pwd)/src
8585
./packages/python/bin/python3 -m ivpm update --cache-backend gha --skip-py-install \
8686
2>&1 | tee /tmp/ivpm-run1.log
87+
grep -q "GHA cache backend activated" /tmp/ivpm-run1.log || \
88+
{ echo "ERROR: expected 'GHA cache backend activated' in first run log"; cat /tmp/ivpm-run1.log; exit 1; }
8789
- name: Verify cache-backend=gha (second run — cache hit)
8890
env:
8991
ACTIONS_CACHE_URL: http://localhost:3000/
@@ -93,7 +95,7 @@ jobs:
9395
export PYTHONPATH=$(pwd)/src
9496
./packages/python/bin/python3 -m ivpm update --cache-backend gha --skip-py-install \
9597
2>&1 | tee /tmp/ivpm-run2.log
96-
# At least one "Restored … from GHA cache" message should appear
97-
grep -q "Restored" /tmp/ivpm-run2.log || \
98-
{ echo "ERROR: expected 'Restored' in second run log"; cat /tmp/ivpm-run2.log; exit 1; }
98+
# Verify the GHA backend was activated (message printed by GHACacheBackend.activate)
99+
grep -q "GHA cache backend activated" /tmp/ivpm-run2.log || \
100+
{ echo "ERROR: expected 'GHA cache backend activated' in second run log"; cat /tmp/ivpm-run2.log; exit 1; }
99101

src/ivpm/cache_backend/gha.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -182,6 +182,7 @@ def link_to_deps(self, package_name: str, version: str, deps_dir: str) -> str:
182182
# ------------------------------------------------------------------ #
183183

184184
def activate(self) -> None:
185+
note(f"GHA cache backend activated (L1: {self._local_dir})")
185186
os.makedirs(self._local_dir, exist_ok=True)
186187

187188
# Set up pip/uv cache directory

0 commit comments

Comments
 (0)