Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update cache: add getCacheEntry to check if a cache entry exists without having to download it #1207

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

MartijnHols
Copy link

@MartijnHols MartijnHols commented Oct 13, 2022

This adds a getCacheEntry export to the cache package that can be used to determine if a cache entry exists. When merged, this method can be used to add a flag to the the cache-action to only check if a cache entry exists for a key. Its cache-hit output can then by used to speed up workflows that use big caches and to skip work if the result of the work is already in the cache.

For context: I am using the cache action to share my build across workflow steps. If the build already exists, there is no point downloading it or building it again and the later steps can just reuse the old cached result.

Remake of #659 which I closed because it was ignored for a year. Rebased to latest working commit on main

Provides a way to determine if the cache exists without being required to download it. This can be used to skip jobs given that the result is already cached.
@MartijnHols MartijnHols requested a review from a team as a code owner October 13, 2022 13:04
@MartijnHols MartijnHols changed the title Add getCacheEntry Update cache: add getCacheEntry to check if a cache entry exists without having to download it Oct 13, 2022
@cdce8p
Copy link
Contributor

cdce8p commented Dec 23, 2022

@MartijnHols I've opened #1286 which would (if merged) provide a new dryRun option for the restore function. I believe this might archive the same result as your getCacheEntry function while being a bit easier to implement and maintain. The cache key checks wouldn't need to be duplicated.

Would love to get your feedback.

@kotewar kotewar self-requested a review December 26, 2022 05:46
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.

2 participants