Hello
I’m setting up a CI/CD Pipeline using Gradle (using Java and a React frontend). I’m quite new to Gradle. The current pipeline basically does something like this:
- gradle build
- gradle test
- gradle checkstyleMain
The problem with this approach is that each stage runs the entire build again. So I went about and changed it to:
- gradle assemble
- gradle test
- gradle checkstyleMain
The problem with gradle test and gradle checkstyleMain is though that they also automatically execute all tasks before them. This seems like something very basic I’m missing. Is it not common to build/assemble everything in the first stage and then reuse those binaries/assets to execute tests etc.? How do people usually go about this? Do people really exclude all tasks explicitly, e.g. gradle test -x compileJava or something?
Any help / best practices on how to properly design such a basic pipeline would be appreciated.