cache icon indicating copy to clipboard operation
cache copied to clipboard

Job failures should not delete branch cache

Open omus opened this issue 1 year ago • 2 comments

If the CI job you are running with julia-actions/cache fails with delete-old-caches: true the cache entry used by that CI job will be deleted and no new cache entry will be uploaded as the actions/cache post-step only runs on successful jobs.

This results in slower subsequent re-runs as we'll end up restoring a cache entry from the base branch if one is available.

omus avatar Mar 21 '24 03:03 omus

Usually the post step is conditionally run based upon the post-if setting. As pyTooling/Actions/with-post-step doesn't specify this I'm not sure we can fix can this beyond setting save-always.

omus avatar Mar 21 '24 03:03 omus

I think the way we'll have to address this is to always leave the latest cache entry remaining. That way if we are cleaning up cache entries on a failed job we avoid cleaning up the last entry.

omus avatar Mar 21 '24 04:03 omus