Cache Gradle distributions in CI - #953
Merged
Merged
Conversation
The teamscale-gradle-plugin tests run against MINIMUM_SUPPORTED_VERSION via TestKit, which downloads that Gradle distribution into GRADLE_USER_HOME/wrapper/dists. setup-gradle only caches "caches" and "notifications" by default, so this ~145 MB download happened on every build and made the v37.0.2 tag build fail when services.gradle.org returned HTTP 502. Add "wrapper" to gradle-home-cache-includes, excluding the "-all" distribution used by our own wrapper, which alone would add ~570 MB. The step is shared between both jobs via a YAML anchor. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
DreierF
enabled auto-merge
August 7, 2026 07:15
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.
Problem
The
v37.0.2tag build failed on the Windows job. All ~24 failingteamscale-gradle-plugintests shared one root cause:The plugin tests run against
TeamscalePlugin.MINIMUM_SUPPORTED_VERSIONviaGradleRunner#withGradleVersion, so TestKit downloads that Gradle distribution at test runtime.gradle/actions/setup-gradlecaches onlycachesandnotificationsfromGRADLE_USER_HOMEby default —wrapperis not included — so this ~145 MB download happened on every build, on every OS, withservices.gradle.orgas a single point of failure.The same applies to our own wrapper distribution: a run with a warm cache and an unchanged Gradle version still re-downloaded
gradle-9.6.1-all.zipon both jobs.Change
Add
wrappertogradle-home-cache-includes, so the distributions underwrapper/distsare cached.wrapper/dists/gradle-*-allis excluded: the-alldistribution used by our own wrapper is ~570 MB on its own, versus ~145 MB for the-binone TestKit needs. Excluding it keeps the cache entry reasonable and leaves the wrapper download exactly as it is today.The step is identical in both jobs, so it is shared with a YAML anchor (
&setup-gradle/*setup-gradle). GitHub Actions has supported anchors since September 2025; only merge keys are unsupported, which aliasing a whole step does not need.Notes
cache-read-only: trueon tag and PR builds means only a build onmasterwrites the cache, so the first run after merge primes the entry and later runs benefit.GRADLE_USER_HOME/wrapper/dists(not in a temp directory as I first assumed): with both candidate locations deleted,gradle-8.10-binreappeared under~/.gradle/wrapper/dists.🤖 Generated with Claude Code