Repository navigation
Cache Gradle's downloads in CI - #142
Merged
Merged
Conversation
Six of the last 120 CI runs lost a job to a download, and every re-run passed. On 2026-10-19 Maven Central reset the connection on three runners and failed DNS on a fourth while they resolved dependencies, and on 2026-10-03 and 2026-10-19 services.gradle.org failed DNS and then timed out on macos-15-intel while the wrapper fetched Gradle. No JDK or GraalVM download failed. gradle/actions/setup-gradle, at the SHA dependency-submission.yml already pins, now runs in every job: it restores the dependencies and the wrapper's distribution from the Actions cache and saves them after builds of the default branch, while pull requests only read. Three paths stay out: the local build cache; the IntelliJ IDE the plugin's tests start, an 852 MB zip that is slower to restore than to download and a third of the repository's 10 GB; and the transforms directory, where that zip is unpacked to 2.1 GB and cannot be left out alone. Leaving paths out needs the default, proprietary cache provider, which is vendored in the action and free for public repositories. JDK downloads are not cached: none has failed, and setup-graalvm finds a cached GraalVM only by its exact version, which would mean pinning versions by hand in two workflows.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Six of the last 120 CI runs lost a job to a download, and every re-run passed:
Connection resetwhile resolving:buildSrc:compileClasspathnodename nor servname provided, or not knownUnknownHostException, thenConnect timed out, fetching gradle-9.8.1-bin.zipNo JDK or GraalVM download failed in those runs.
gradle/actions/setup-gradlev6.4.0, the SHA dependency-submission.yml already pins, now runs inbuild,jdkandnative. It restores the dependencies and the wrapper's distribution from the Actions cache and saves them after builds of the default branch; pull requests read. Three paths stay out throughgradle-home-cache-excludes:caches/build-cache-1, the local build cache;caches/modules-2/files-2.1/com.jetbrains.intellij.idea, the 852 MB IDE zip the IntelliJ plugin's tests start, andcaches/*/transforms, where a transform unpacks it to 2.1 GB: slower to restore than to download from JetBrains, and a third of the repository's 10 GB cache.The default cache provider is Gradle's proprietary library, vendored in the action and free for public repositories; the open-source
basicprovider cannot leave paths out. JDK downloads are not cached: none has failed, and setup-graalvm finds a cached GraalVM only by its exact version, which would mean pinning versions by hand in ci.yml and release.yml.Still on the network: wrapper validation fetches checksums from services.gradle.org while 9.8.2 is in no cached
valid-wrappers.json, so on the first run and on PR runs after a wrapper bump; thejdkjob's TestKit builds download their Gradle outside Gradle User Home; JDKs, GraalVM and the IDE as before.act --listparses the workflow. Not run in CI yet: the "Gradle Build Results" summary of the first run on 21.X.X should list what was saved, and the next run what was restored.