This is an automated email from the ASF dual-hosted git repository.
sjanc pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/mynewt-core.git
The following commit(s) were added to refs/heads/master by this push:
new 04c48713d ci: Include runner image in ccache keys
04c48713d is described below
commit 04c48713d19311ebc43631b590c35344697421e0
Author: Szymon Janc <[email protected]>
AuthorDate: Thu Oct 22 18:46:02 2026 +0200
ci: Include runner image in ccache keys
When ubuntu-latest switched from 24.04 to 26.04, ccache restored
entries created on 24.04, but host compiler and ccache version changed,
so hit rate fell to 5-33%. Entries were replaced only by next master
run that completed, and while new image is rolled out jobs may run on
both images, replacing each other's entries.
Add runner image (ImageOS, e.g. ubuntu26) to ccache keys, so entries
from different images are kept separately and new image starts with
empty cache instead of restoring entries it can't use.
Assisted-by: Claude:claude-opus-5-5
---
.github/actions/cache-cleanup/action.yml | 7 ++++---
.github/actions/ccache-restore/action.yml | 10 ++++++++--
.github/actions/ccache-save/action.yml | 2 +-
3 files changed, 13 insertions(+), 6 deletions(-)
diff --git a/.github/actions/cache-cleanup/action.yml
b/.github/actions/cache-cleanup/action.yml
index a1f6b4561..4f285ffe4 100644
--- a/.github/actions/cache-cleanup/action.yml
+++ b/.github/actions/cache-cleanup/action.yml
@@ -20,9 +20,10 @@
name: Remove superseded caches
description: >
Remove caches superseded by newer ones. Caches are saved only from
- master branch with unique keys (e.g. ccache-<job>-<run_id>-<attempt>)
- and only newest entry of each kind is used by later runs, so older
- entries only take space from repository cache quota. Should be used
+ master branch with unique keys (e.g.
+ ccache-<image>-<job>-<run_id>-<attempt>) and only newest entry of each
+ kind is used by later runs, so older entries only take space from
+ repository cache quota. Should be used
from job run after all jobs saving caches are completed. Requires
actions: write permission.
diff --git a/.github/actions/ccache-restore/action.yml
b/.github/actions/ccache-restore/action.yml
index e754643ca..8e34cde77 100644
--- a/.github/actions/ccache-restore/action.yml
+++ b/.github/actions/ccache-restore/action.yml
@@ -23,6 +23,10 @@ description: >
ccache directory from cache. Must be used after toolchain is installed
so that ccache wrappers are found in PATH before real compilers (unless
job sets PATH itself, see gcc-target-build).
+ Runner image (e.g. ubuntu24) is part of cache key, since host compiler
+ and ccache versions differ between images, so entries from other image
+ would be misses only, and both images are used while ubuntu-latest is
+ switched to new one.
Supported only on Linux, does nothing on other systems.
inputs:
@@ -60,6 +64,7 @@ runs:
echo "CCACHE_COMPILERCHECK=content"
echo "CCACHE_MAXSIZE=${{ inputs.max-size }}"
echo "CCACHE_JOB_START=$(date +%s)"
+ echo "CCACHE_IMAGE=${ImageOS:-unknown}"
} >> "$GITHUB_ENV"
- name: Restore ccache directory
@@ -67,12 +72,13 @@ runs:
uses: actions/cache/restore@v6
with:
path: ${{ runner.temp }}/ccache
- key: ccache-${{ inputs.key }}-${{ github.sha }}
- restore-keys: ccache-${{ inputs.key }}-
+ key: ccache-${{ env.CCACHE_IMAGE }}-${{ inputs.key }}-${{ github.sha }}
+ restore-keys: ccache-${{ env.CCACHE_IMAGE }}-${{ inputs.key }}-
- name: Reset ccache statistics
if: runner.os == 'Linux'
shell: bash
run: |
+ echo "Runner image: $CCACHE_IMAGE"
ccache --version | head -1
ccache --zero-stats
diff --git a/.github/actions/ccache-save/action.yml
b/.github/actions/ccache-save/action.yml
index bcea10b67..c10464df7 100644
--- a/.github/actions/ccache-save/action.yml
+++ b/.github/actions/ccache-save/action.yml
@@ -64,4 +64,4 @@ runs:
uses: actions/cache/save@v6
with:
path: ${{ runner.temp }}/ccache
- key: ccache-${{ inputs.key }}-${{ github.run_id }}-${{
github.run_attempt }}
+ key: ccache-${{ env.CCACHE_IMAGE }}-${{ inputs.key }}-${{
github.run_id }}-${{ github.run_attempt }}