Skip to content

ci: fix stale benchmark cache by using unique keys - #161

Open
sailingKieler wants to merge 1 commit into
mainfrom
cs/benchmark-cache
Open

sailingKieler wants to merge 1 commit into
mainfrom
cs/benchmark-cache

Conversation

@sailingKieler

Copy link
Copy Markdown
Member

The benchmark action setup example of https://github.com/benchmark-action/github-action-benchmark/#minimal-setup has a flaw in updating the cached benchmark results with actions/cache, because of:

If the provided key matches an existing cache, a new cache is not created and if the provided key doesn't match an existing cache, a new cache is automatically created provided the job completes successfully.

(see https://github.com/actions/cache#using-a-combination-of-restore-and-save-actions)

image

See also the recent runs of Benchmark/main, e.g. https://github.com/TypeFox/fastbelt/actions/runs/39764627738/job/119776904591:
image

This PR refines the benchmark workflow to persist a new benchmark snapshot on each run on branch main.

actions/cache never overwrites an existing key, so the fixed
'<os>-benchmark' key froze the benchmark baseline after the first save.
Split into cache/restore (newest entry via restore-keys) and cache/save
(unique run_id key, main branch only).

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
@sailingKieler
sailingKieler requested a review from msujew October 23, 2026 15:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant