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
Pass additional restore-keys to cache action #366
Comments
I see that this: #285 was recently merged, but the cost doesn't outweigh the gains. It is not realistic to bust the cache completely whenever a version changes. Many projects nowadays rely on automated dependency updates, not using A better way to handle this would be to expose an input to let people decide how often they want to expire their caches. |
Hello @gustavovnicius |
@gustavovnicius the cache should be updated whenever the dependencies changed. It is expected behaviour and actually it is not realistic the update of dependencies happens too often. Nevertheless for some specific use cases it is natural to use full-featured https://github.com/actions/cache actions instead of its simplified implementation built-in into setup-java action. |
The PR #285 should be reverted. It makes caching useless unless the code is exactly the same. |
What I'm proposing on #367 is a solution that works both ways. |
The cache must be renewed if any dependency has changed. In the other case the cache keeps obsolete dependencies and grows infinitely. |
Built-in cache is not intended to be flexible, it is intended to work out of box in the most cases. For the specific complex caching that requires flexibility and customisation there's https://github.com/actions/cache action |
The feature request is declined because the requested functionality exist in the other action https://github.com/actions/cache |
As can be seen in their examples: https://github.com/actions/cache/blob/main/examples.md#java---gradle
It is recommended that additional restore-keys are passed when using
actions/cache
. https://github.com/actions/cache#inputshttps://docs.github.com/en/actions/using-workflows/caching-dependencies-to-speed-up-workflows#matching-a-cache-key
setup-java/src/cache.ts
Line 100 in 5b36705
The text was updated successfully, but these errors were encountered: