Piotr Krzemiński
06/28/2023, 2:10 PMUP-TO-DATE
). Any clues?andylamax
06/28/2023, 2:11 PMChris Lee
06/28/2023, 2:15 PMChris Lee
06/28/2023, 2:16 PMGradle User Home already exists: will not restore from cache.
Chris Lee
06/28/2023, 2:18 PMAdam S
06/28/2023, 2:22 PMChris Lee
06/28/2023, 2:23 PM• In the main step:Gradle User Home already exists: will not restore from cache.
• In the post-action:Even if not, no point in caching if it isn’t persisted between CI runs 😞Cache will not be saved: not restored in main action step.
Vampire
06/28/2023, 2:23 PMVampire
06/28/2023, 2:24 PMPiotr Krzemiński
06/28/2023, 2:25 PMandylamax
06/28/2023, 2:36 PMPiotr Krzemiński
06/28/2023, 3:14 PMVampire
06/28/2023, 3:15 PMVampire
06/28/2023, 3:16 PMChris Lee
06/28/2023, 3:17 PMChris Lee
06/28/2023, 3:19 PMCache is read-only: will not save state for use in subsequent builds.
Chris Lee
06/28/2023, 3:24 PMVampire
06/28/2023, 3:26 PMVampire
06/28/2023, 3:27 PMChris Lee
06/28/2023, 3:31 PMChris Lee
06/28/2023, 3:34 PMChris Lee
06/28/2023, 3:41 PMgradle-home-cache-cleanup: true
which allows for cleaning up unused files in the Gradle home directory, such as when you upgrade a Gradle version, JDK toolchain version, etc.
If using toolchains those JDKs aren’t automagically cached, configuration required:
gradle-home-cache-includes: |
jdks
caches
notifications
Piotr Krzemiński
06/28/2023, 3:47 PMPiotr Krzemiński
06/28/2023, 3:49 PMPiotr Krzemiński
06/28/2023, 3:50 PMChris Lee
06/28/2023, 3:51 PMPiotr Krzemiński
06/30/2023, 5:54 AMAdam S
06/30/2023, 1:16 PMChris Lee
06/30/2023, 1:18 PMChris Lee
06/30/2023, 1:19 PMPiotr Krzemiński
06/30/2023, 1:19 PMPiotr Krzemiński
06/30/2023, 1:20 PMAdam S
06/30/2023, 1:22 PM./gradlew check
twice then the second task would instantly return ‘success’). But on a fresh checkout then Build Cache is needed to ‘remember’ any previous runs.Piotr Krzemiński
06/30/2023, 1:24 PMChris Lee
06/30/2023, 1:31 PMgradle init
creates projects with the build cache enabled by default.
# This file was generated by the Gradle 'init' task.
# <https://docs.gradle.org/current/userguide/build_environment.html#sec:gradle_configuration_properties>
org.gradle.parallel=true
org.gradle.caching=true
Vampire
06/30/2023, 1:33 PMChris Lee
06/30/2023, 1:34 PMPiotr Krzemiński
06/30/2023, 1:38 PMFROM-CACHE
success baby thanks folks!Piotr Krzemiński
06/30/2023, 1:48 PMPiotr Krzemiński
06/30/2023, 1:49 PMChris Lee
06/30/2023, 1:52 PMChris Lee
06/30/2023, 2:01 PMPiotr Krzemiński
06/30/2023, 2:06 PMChris Lee
06/30/2023, 2:07 PMVampire
06/30/2023, 2:07 PMVampire
06/30/2023, 2:07 PMVampire
06/30/2023, 2:08 PMVampire
06/30/2023, 2:08 PMPiotr Krzemiński
06/30/2023, 2:09 PMVampire
06/30/2023, 2:09 PMVampire
06/30/2023, 2:09 PMPiotr Krzemiński
06/30/2023, 2:10 PMPiotr Krzemiński
06/30/2023, 2:10 PMorg.gradle.configuration-cache=true
?Chris Lee
06/30/2023, 2:11 PMVampire
06/30/2023, 2:11 PMVampire
06/30/2023, 2:11 PMPiotr Krzemiński
06/30/2023, 2:11 PMVampire
06/30/2023, 2:11 PMVampire
06/30/2023, 2:11 PMChris Lee
06/30/2023, 2:12 PMPiotr Krzemiński
06/30/2023, 2:14 PMVampire
06/30/2023, 2:16 PMVampire
06/30/2023, 2:16 PMAdam S
06/30/2023, 2:19 PMgradle.properties
org.gradle.caching=true
org.gradle.unsafe.configuration-cache=true
org.gradle.unsafe.configuration-cache-problems=warn
org.gradle.parallel=true
and it always works fine (except with Kotlin Multiplatform projects, because that’s not Config Cache compatible yet)
The signing plugin and Maven Central publishing aren’t compatible with config cache, but they can just be disabled as required by adding --no-configuration-cache
to the GitHub step, so the rest of the build still benefitsVampire
06/30/2023, 2:21 PMunsafe
anymore.
And signing
and maven-publish
are compatibleVampire
06/30/2023, 2:21 PMChris Lee
06/30/2023, 2:21 PMorg.gradle.configuration-cache=true
Unclear if the unsafe ones still work in recent Gradle versions.Vampire
06/30/2023, 2:22 PMAdam S
06/30/2023, 2:22 PMVampire
06/30/2023, 2:23 PMio.github.gradle-nexus.publish-plugin
pluginAdam S
06/30/2023, 2:24 PMVampire
06/30/2023, 2:26 PMVampire
06/30/2023, 2:27 PM--parallel
before.Vampire
06/30/2023, 3:10 PMInterestinglyIt does not by default. Only if you tell it the not-default "yes" to the question about using experimental features. 🙂creates projects with the build cache enabled by default.gradle init
Chris Lee
06/30/2023, 3:11 PMChris Lee
06/30/2023, 3:12 PMGenerate build using new APIs and behavior (some features may change in the next minor release)? (default: no) [yes, no] yes
Adam S
07/01/2023, 7:44 AMUnclear if the unsafe ones still work in recent Gradle versions.the
.unsafe
variants still work and aren’t deprecated (yet) :) https://docs.gradle.org/8.2/userguide/upgrading_version_8.html#configuration_caching_options_renamed