What's the recommended GitHub actions setup when u...
# develocity
b
What's the recommended GitHub actions setup when using Maven in order to preserve the local build cache in GitHub's action cache?
j
Hi @Benedikt Ritter, we do not maintain any specific GitHub action to save/restore the cache. The best way is probably to use the actions/cache steps (assuming you are not using self-hosted runners) to restore the
~/.m2/.develocity/build-cache
folder. Please let me know if you need further details
b
Hey @Jerome Prinet 👋 I was wondering how to construct the cache key for the actions cache. Examples I've found online look like this
key: ${{ runner.os }}-${{hashFiles('**/lockfiles') }}
So I guess I would have to hashFiles for all pom.xml and Java files?!
j
It would probably be too conservative. What about a cache key based on the branch name? Quarkus is also adding a time window, see their code for reference. The OS is implicitly part of the cache key and do not need to be added https://github.com/marketplace/actions/cache#inputs
thank you 1