Speed up CI via Gradle caching (setup-gradle + build cache)#685
Merged
Conversation
Replace `actions/setup-java`'s `cache: gradle` with the `setup-gradle` action, which persists the Gradle User Home (dependencies, wrapper, and the local build cache) across CI runs and writes the cache only from the default branch. Applies to the propagated templates in `.github-workflows/` and to config's own detekt workflow. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Set `org.gradle.caching=true` so Gradle reuses task outputs keyed by their inputs. Combined with `setup-gradle` persisting `caches/build-cache-1`, cold CI builds skip work whose inputs are unchanged. `org.gradle.parallel=true` was already enabled. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Move `actions/checkout` to `v6` and `actions/setup-java` to `v5` across all CI workflows so the action pins stay consistent. This accompanies the `setup-gradle` switch in the Gradle-invoking workflows. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
`gradle/actions/setup-gradle` manages the daemon and cache lifecycle, so the `--no-daemon` workaround for the old `actions/cache` mechanism (actions/cache#454) is no longer needed. Allowing the daemon should speed up the slow Windows builds. Revisit if the Windows pilot surfaces cache-locking issues. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Complete the `coreJava`->`coreJvm` rename: update the stale comment and the commented-out example in `config-tester.gradle.kts`, and the snippet, dependant list, and link URL in `README.md`. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Contributor
There was a problem hiding this comment.
Pull request overview
Enables Gradle’s caching layers centrally in the config submodule so that consuming Spine repositories can benefit from faster CI without per-repo workflow edits, while also updating related docs/config-tester references for the core-java → core-jvm rename.
Changes:
- Switched Gradle-invoking workflows to
gradle/actions/setup-gradle@v6and removedactions/setup-java’scache: gradleto avoid cache-provider conflicts. - Enabled the local Gradle build cache via
org.gradle.caching=trueingradle.properties. - Updated workflow action pins (
actions/checkout@v6,actions/setup-java@v5) and aligned ConfigTester docs/scripts tocore-jvm.
Reviewed changes
Copilot reviewed 14 out of 14 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| README.md | Updates ConfigTester usage examples and repo link from core-java to core-jvm. |
| gradle.properties | Enables Gradle local build cache (org.gradle.caching=true) with CI-oriented commentary. |
| buildSrc/src/main/kotlin/io/spine/gradle/ConfigTester.kt | Renames SpineRepos.coreJava to SpineRepos.coreJvm and adjusts KDoc formatting. |
| buildSrc/src/main/kotlin/config-tester.gradle.kts | Updates ConfigTester “dependants” list to use core-jvm. |
| .github/workflows/gradle-wrapper-validation.yml | Updates checkout action pin to actions/checkout@v6. |
| .github/workflows/detekt-code-analysis.yml | Migrates to setup-java@v5 + setup-gradle@v6, removing setup-java Gradle caching. |
| .github/workflows/check-links.yml | Updates checkout action pin to actions/checkout@v6. |
| .github-workflows/remove-obsolete-artifacts-from-packages.yaml | Updates checkout action pin to actions/checkout@v6. |
| .github-workflows/publish.yml | Migrates to setup-java@v5 + setup-gradle@v6, removing setup-java Gradle caching. |
| .github-workflows/increment-guard.yml | Migrates to setup-java@v5 + setup-gradle@v6, removing setup-java Gradle caching. |
| .github-workflows/ensure-reports-updated.yml | Updates checkout action pin to actions/checkout@v6. |
| .github-workflows/build-on-windows.yml | Migrates to setup-java@v5 + setup-gradle@v6 and removes --no-daemon from the Windows build invocation. |
| .github-workflows/build-on-ubuntu.yml | Migrates to setup-java@v5 + setup-gradle@v6, removing setup-java Gradle caching. |
| .agents/tasks/gradle-caching-plan.md | Updates the rollout/verification plan text to match the new pilot-based validation approach and tooling rename. |
armiol
approved these changes
Jun 9, 2026
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.
What & why
configis the shared submodule pulled into every Spine repository, so enabling Gradle's freecaching layers here speeds up CI org-wide with no per-repo edits. This PR turns on the
dependency cache and the local build cache via
gradle/actions/setup-gradle, and modernizes theworkflow action pins.
Changes
Phase 1 — switch CI to
gradle/actions/setup-gradle@v6Removed
actions/setup-java'scache: gradle(which conflicts withsetup-gradle) and addedsetup-gradleafter Java setup in every Gradle-invoking workflow.setup-gradlepersists theGradle User Home — dependencies, wrapper, and
caches/build-cache-1— across CI runs, writingthe cache only from the default branch (PR builds read it).
.github-workflows/):build-on-ubuntu,build-on-windows,publish,increment-guardconfig's own CI (.github/workflows/):detekt-code-analysisPhase 2 — enable the local build cache (
gradle.properties)Set
org.gradle.caching=true(was commented out).org.gradle.parallel=truewas already enabled.Action-version consistency
actions/checkout@v6andactions/setup-java@v5across all workflows — several still trailed on@v4.Windows build speedup
Dropped
--no-daemonfrombuild-on-windows. It was a workaround for the oldactions/cachemechanism (actions/cache#454) that
setup-gradlemakes unnecessary; allowing the daemon shouldnoticeably cut Windows build time.
Also on this branch
ConfigTester/config-tester.gradle.kts+README.md: completed thecore-java→core-jvmrepo rename (symbol, comments, dependant list, and link URL).
.agents/tasks/gradle-caching-plan.md: the implementation plan and its verification rewrite.Deferred by design
warn mode (
org.gradle.configuration-cache.problems=warn).How to verify
setup-gradleonly runs on GitHub, so the real signal comes from a pilot rollout in a consumingrepo (suggest
base): bump theconfigsubmodule, run./config/pull, then read thebuild-on-ubunturun'ssetup-gradleJob Summary for cache entries restored/saved and compareoverall job wall-clock before vs after. This PR's own CI (
config'sdetektandgradle-wrapper-validation) is the first real exercise of thesetup-gradle+checkout@v6changes.Reviewer notes
--no-daemonremoval is the one behavioral change with residual risk: if cachesave/restore collides with a running daemon on Windows, revert the flag. To be confirmed in the
Windows pilot.
🤖 Generated with Claude Code