Adam
07/22/2024, 1:56 PMDaz DeBoer
07/22/2024, 4:51 PMgradle-home-cache-cleanup
enabled for your workflow?
If not, you might want to try that, or even better switch to the prerelease version of v4
, which has this enabled by default.
uses: gradle/actions/setup-gradle@prerelease/v4
.Daz DeBoer
07/22/2024, 4:52 PMgradle-home-cache-cleanup
didn't purge unused transforms.Chris Lee
07/22/2024, 4:53 PMDaz DeBoer
07/22/2024, 5:07 PM~/.gradle/caches/transforms-4
directory isn't being cleaned up correctly.
https://github.com/kotest/kotest/actions/runs/10043939320/job/27757913559#step:16:69Daz DeBoer
07/22/2024, 5:30 PMtransforms-4
directory will continue to grow over time.
If possible, update to Gradle 8.9 (or 8.8) and you should see reduced cache entry sizes.Chris Lee
07/22/2024, 5:33 PMAdam
07/22/2024, 6:01 PMAdam
07/22/2024, 6:01 PMDaz DeBoer
07/22/2024, 6:41 PMAdam
07/22/2024, 6:45 PMAdam
07/22/2024, 6:46 PMChris Lee
07/22/2024, 6:53 PMChris Lee
07/22/2024, 7:16 PMIt’d help if artifact transforms could be classpath isolated. At the moment, any change in a build script invalidates all artifact transforms.@Adam this could be related to differences in
buildSrc
vs a composite build, perhaps try changing to a composite build.Adam
07/22/2024, 7:20 PMChris Lee
07/22/2024, 7:21 PMAdam
07/22/2024, 7:22 PMChris Lee
07/22/2024, 7:22 PMAdam
07/22/2024, 7:23 PMAdam
07/22/2024, 7:24 PMAdam
07/22/2024, 7:24 PMChris Lee
07/22/2024, 7:26 PMDaz DeBoer
07/22/2024, 9:59 PMif a change to the transforms results in a new cache entry then there isn’t really much cleanup to do - the older entries will age-out of the cache. BUT: that leaves 4.xGB per-transform-cache-entry, which seems excessive, especially given that a kotest GHA build writes multiple transform cache entries, quickly exceeding the 10GB limit.There are multiple different "caches" here. The
~/.gradle/caches/transforms-3
directory is where the generated transform outputs are placed. Even with the build cache disabled, the outputs are saved there.
The setup-gradle
action then zips up the entire transforms-3
directory and saves it to the GitHub Actions cache.
The core problem is that the old transform outputs are never cleaned up, so the transforms-3 directory grows over time. This is why each of the cache entries is so big.
With Gradle 8.8, the transform outputs were moved to caches/8.9/transforms
, and these are now cleaned up like other things in the Gradle User Home. So before saving to the GitHub Actions cache, the setup-gradle
action will attempt to purge unused entries. I suspect/hope that the resulting GHA cache entry will be much smaller than 4Gb.