mirror of
https://github.com/D-Modem/hardware.git
synced 2026-11-28 17:48:05 -08:00
CI: key the package caches on the runner image
ImageOS and ImageVersion are the runner's environment variables, not the
workflow's env context, so ${{ env.ImageVersion }} was empty and the
cache key never changed with the image. Build the key in the shell.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01B82eRUAp3wTZAV7UCEiC4S
This commit is contained in:
1 file changed
+3
-2
@@ -30,13 +30,14 @@ runs:
|
||||
run: |
|
||||
pkgs=$(printf '%s\n' $PKGS | sort -u | tr '\n' ' ')
|
||||
echo "pkgs=$pkgs" >> "$GITHUB_OUTPUT"
|
||||
echo "hash=$(printf '%s|%s|%s' "$pkgs" "$PPA" "$REC" | sha256sum | cut -c1-16)" >> "$GITHUB_OUTPUT"
|
||||
# (ImageOS, ImageVersion: the runner's environment, not the env context)
|
||||
echo "key=apt-${ImageOS:-none}-$RUNNER_ARCH-${ImageVersion:-none}-$(printf '%s|%s|%s' "$pkgs" "$PPA" "$REC" | sha256sum | cut -c1-16)" >> "$GITHUB_OUTPUT"
|
||||
|
||||
- id: restore
|
||||
uses: actions/cache/restore@v4
|
||||
with:
|
||||
path: /tmp/apt-cache
|
||||
key: apt-${{ env.ImageOS }}-${{ runner.arch }}-${{ env.ImageVersion }}-${{ steps.key.outputs.hash }}
|
||||
key: ${{ steps.key.outputs.key }}
|
||||
|
||||
- id: install
|
||||
shell: bash
|
||||
|
||||
Reference in new issue
Block a user