Cache multiple paths
See original GitHub issueIt can be useful to cache multiple directories, for example from different tools like pip and pre-commit.
With Travis CI (ignoring their pip: true
shortcut):
cache:
directories:
- $HOME/.cache/pip
- $HOME/.cache/pre-commit
The Actions equivalent requires adding a duplicated step for each directory, something like:
- name: pip cache
uses: actions/cache@preview
with:
path: ~/.cache/pip
key: ${{ matrix.python-version }}-pip
- name: pre-commit cache
uses: actions/cache@preview
with:
path: ~/.cache/pre-commit
key: ${{ matrix.python-version }}-pre-commit
Perhaps also allow multiple directories in a single step, something like this?
- name: pip cache
uses: actions/cache@preview
with:
path:
- ~/.cache/pip
- ~/.cache/pre-commit
key: ${{ matrix.python-version }}
Issue Analytics
- State:
- Created 4 years ago
- Reactions:64
- Comments:31 (13 by maintainers)
Top Results From Across the Web
Using GitHub cache action with multiple cache paths?
I was able to make it work with a few modifications;. use relative paths instead of absolute; use a hash of the content...
Read more >Caching dependencies to speed up workflows - GitHub Docs
Multiple workflow runs in a repository can share caches. ... You can specify a single path, or you can add multiple paths on...
Read more >GitHub Actions: V2 cache actions | GitHub Changelog
Added support for caching multiple paths, wildcard patterns path or single file path; Increased performance and improved cache sizes using zstd ...
Read more >CI build: How to cache different paths by different keys? - GitLab
I suspect it should be possible by splitting pages into multiple jobs, one doing the compilation and one the creation of the pages, ......
Read more >Caching Strategies - CircleCI
Split cache keys by directory. Having multiple directories under a single cache key increases the chances of there being a change to the...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Certainly not all ecosystems, but for some major ones.
Compare the config for Python’s pip with Travis CI:
With GitHub Actions:
10 characters vs. 1,000 characters!
I know which I’m be more confident using, and prefer suggesting for projects to add 😃
Travis also has shortcuts like:
The flexibility of GHA’s caching is good, but it would be even better to have some user-friendly shortcuts. Thanks!
We made a scoping call for the v1 to not support multiple paths. This is something we do plan to look at for the future.