Closed hanneskaeufler closed 1 day ago
Thanks for the report. A few things in your logs stand out.
cache-read-only: true
...
Restored wrapper-zips with key gradle-wrapper-zips-v1-9b12742562b89ad80b153fd0e40e926d to /home/ec2-user/.gradle/wrapper/dists/gradle-8.8-bin/dl7vupf4psengwqhwktix4v1
...
Restored wrapper-zips with key gradle-wrapper-zips-v1-df6ecc383658ce44d9cbac4d1bfd12bf to /home/ec2-user/.gradle/wrapper/dists/gradle-8.9-bin/90cnw93cvbtalezasaz0blq0a
The cache-read-only
setting is likely because you are running this job from a branch other than main
: see here for an explanation.
With v4
you should have a link to this doc in the generated Job Summary.
Then we see that wrappers for Gradle 8.8 and Gradle 8.9 are restored, but not Gradle 8.10. So the most likely explanation is that the Job is restoring a cache entry written from a Job that didn't run Gradle 8.10.
If you are sure that isn't the case, then we could investigate whether there is a bug in the action that fails to restore Gradle 8.10 in particular,
Thanks for the input! I did based on your assessment actually double check a couple of things and notice that not all of our jobs got upgrade to @v4.0.1, some were accidentally left back at @v3. So I fixed that and will monitor some more. Also activated the job summary to get a better look at that.
Then we see that wrappers for Gradle 8.8 and Gradle 8.9 are restored, but not Gradle 8.10.
Are those "wrapper zips" containing the full gradle installation? I had a brief look at my local gradle cache and couldn't really understand where gradle itself is located.
Also activated the job summary to get a better look at that.
Did you have this disabled for some reason? Or was it not enabled by default?
Are those "wrapper zips" containing the full gradle installation? I had a brief look at my local gradle cache and couldn't really understand where gradle itself is located.
Yes, if you execute using the Gradle wrapper (./gradlew ...
) then the Gradle distribution will be downloaded and stored in the Gradle User Home at ~/.gradle/wrapper/dists
. This is the recommended approach to execute Gradle.
@hanneskaeufler I'm going to close this issue, as there's no evidence that Gradle wrappers or installations are not being cache correctly. Feel free to comment here if you continue to experience issues and we can investigate further.
Observed behaviour
Gradle 8.10 is downloaded for every single CI job
Expected behaviour
Gradle is cached and not downloaded from the internet every time
Details
While this certainly is against my assumption, I'm not sure whether this is a feature request or a bug. I'm using gradle/actions/setup-gradle@v3 and recently upgraded to gradle/actions/setup-gradle@v4.0.1, same behaviour
Gradle test logs:
Cache action logs: