When is hashFiles() actually needed? #1249
Unanswered
marco-brandizi
asked this question in
General
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hi all,
I see
hashFiles()
used a lot to define cache keys, and I've used it myself for years, copy-pasting from the Maven example:However, in the GH interface, I've noticed I've several caches that maybe don't need to be created.
I mean, I run the build with
mvn --update-snapshots ...
, so, even if it restores always the same cache, no matter if the dependencies are changed, it should still work fine, for Maven keeps checking (quickly) what has changed, re-download new updates and downloads dependencies it doesn't find in the cached repo. So, it should be fine to have just one cache and one key (per OS).Am I right? Would something like
key: ${{ runner.os }}-m2-v1
still work, in the situation above? Or am I missing some possible troubles?Many thanks in advance.
Beta Was this translation helpful? Give feedback.
All reactions