Skip to content

Cache Gradle's downloads in CI - #142

Merged
abashev merged 1 commit into
21.X.Xfrom
ci-dependency-caches
Oct 20, 2026
Merged

abashev merged 1 commit into
21.X.Xfrom
ci-dependency-caches

Conversation

@abashev

@abashev abashev commented Oct 20, 2026

Copy link
Copy Markdown
Collaborator

Six of the last 120 CI runs lost a job to a download, and every re-run passed:

date job what failed
2026-10-19 native (windows-x86-64), native (linux-aarch64) twice Maven Central: Connection reset while resolving :buildSrc:compileClasspath
2026-10-19 native (macos-x86-64) Maven Central: nodename nor servname provided, or not known
2026-10-03, 2026-10-19 native (macos-x86-64) services.gradle.org: UnknownHostException, then Connect timed out, fetching gradle-9.8.1-bin.zip

No JDK or GraalVM download failed in those runs.

gradle/actions/setup-gradle v6.4.0, the SHA dependency-submission.yml already pins, now runs in build, jdk and native. 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 through gradle-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, and caches/*/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 basic provider 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; the jdk job's TestKit builds download their Gradle outside Gradle User Home; JDKs, GraalVM and the IDE as before.

act --list parses 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.

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.
@abashev
abashev merged commit 3e13850 into 21.X.X Oct 20, 2026
17 checks passed
@abashev
abashev deleted the ci-dependency-caches branch October 20, 2026 16:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant