Hi,
I’ve got the idea to split our CI workflows on GitHub using the Gradle GitHub action into multiple workflows, but still want to leverage the Gradle build cache in all workflows.
Currently we have one GitHub workflow, which roughly consists of three “stages”:
- compilation, checkstyle, spotless, assemble/Javadoc
-
test
target -
intTest
target
The Gradle cache(s) are properly loaded and restored - and that’s fine.
Since the code base grew and (depending on the change) the whole workflow now takes a while (70 minutes at max at the moment), but I wanna bring it back to ~20 minutes.
So I had the idea to split the single workflow into different workflows running in parallel.
+---------------------+
| initial CI workflow |
+---------------------+
|
+--------------+-----------------+-----------------------+
| | | |
+-------------+ +----------------+ +------------------+ +----------------+
| checkstyle, | | ./gradlew test | | ./gradle intTest | | more workflows |
| etc | | | | | | |
+-------------+ +----------------+ +------------------+ +----------------+
| | | |
+--------------+-----------------+-----------------------+
|
+---------------------+
| final CI workflow |
| (maybe) |
+---------------------+
The problem at hand is that the Gradle cache results from multiple workflows diverge: for example, one workflow has the test
results, another has the intTest
results, and so on.
My question is, whether there’s a way to aggregate the “final state” of the Gradle caches from the parallel workflows. Or could I “just” take the caches from all parallel workflows and just “copy those together”? Or is there already something available to do that?
Robert