julia-actions / cache

A shortcut action to cache Julia artifacts, packages, and registries.
MIT License
38 stars 8 forks source link

Job failures should not delete branch cache #113

Closed omus closed 2 weeks ago

omus commented 3 months ago

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 commented 3 months ago

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 commented 3 months ago

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.