actions / cache

Cache dependencies and build outputs in GitHub Actions
MIT License
4.45k stars 1.18k forks source link

Restore multiple chaces/files at once #1117

Closed frenzymadness closed 1 year ago

frenzymadness commented 1 year ago

Hi.

I'd like to use the cache/save and cache/restore actions to collect and analyze files from multiple jobs. Let's say I save 10 files in 10 individual jobs each with a unique filename and a unique cache key. Then I'd like to download all of the files in a single job where I'd combine them and produce results. All of those jobs are run in a single workflow.

Is this possible without invoking cache/restore action for every individual file again and again and without repeating their unique keys?

Something like: restore all the cache entries matching this key (regex, glob, prefix … you name it).

By the way, it seems that this is supported by upload-artifacts/download-artifacts actions, see https://github.com/actions/download-artifact#download-all-artifacts

pallavx commented 1 year ago

Hi @frenzymadness,

Restoring all caches by prefixes is not supported by this action.

Additionally, this might not be the best use-case for actions/cache. You can consider using actions/download-artifact for your use-case.

skjnldsv commented 1 year ago

@pallavx I have the same issue. While artifacts are good, they are insanely slow compared to caches. I think being able to restore multiple caches to share data between a matrix of actions would be a nice enhancement :)

PS: could you fix the typo in the title, it took me some time to find this issue because of it :see_no_evil: That would help search engines indexing this ticket :wink: