I see a lot of my CI kotlin compile (maybe all) ar...
# gradle
e
I see a lot of my CI kotlin compile (maybe all) are missing build cache. What can be the cause? (Sorry if it was answered already or there is no answer since information is not enough).
Looks like doesn't happen on my local build.
t
There isn’t enough information here. Are you using a remote build cache or a local build cache? Is your CI running in a container that gets disposed and recreated each time or is it running on persistent dedicated hardware?
e
It uses only local build cache. CI is running in container, not sure if it is disposed or reused. This is GitHub CI hosted machines.
t
Yeah so that is most likely creating a new “clean” container each time, so there is no local cache that is persisted between builds
e
Except, we save and restore
.gradle
folders between builds
This is also end of the day. so only my builds are run after each other. So, I'm pretty sure the cache of previous build should be reused maximum.
c
It will only use cache from the master branch, or prior builds of the same branch.
t
I haven’t use github CI personally, but my guess would be that it isn’t saving this cache correctly after each build, or it isn’t restoring it correctly
c
This is to prevent a malicious branch from poisoning the cache of other branches.
I don’t recommend saving the entire gradle folder, but being more selective of the dependencies, gradle binary, and gradle cache. This avoids leaking secrets that you might write to ~/.gradle/gradle.properties
e
Carter, it is end of the day
So, I'm pretty sure only my branch is executed
Just checked log and I see that my jobs are running only
I did scan and I see that kotlin compile have the different cache key
e
We are using it already 🙂
c
I find sometimes the cache behavior is mysterious. But if I add another commit to a branch, I do see it applying the cache to that branch.
e
I need to find why the cache key for kotlin compile are different
Interesting that they have two different types - one is kotlin compile and one is kotlin compile with workers
Aha, I added parallel execution in between, so this might be the cause