Gradle doesn't really expose an option for you to run your build without running tests. We were able to make this work by looking for an environment variable:
checkstyleMain.onlyIf { !System.getenv('SKIP_TESTS') }
checkstyleTest.onlyIf { !System.getenv('SKIP_TESTS') }
compileTestJava.onlyIf { !System.getenv('SKIP_TESTS') }
jacocoTestCoverageVerification.onlyIf { !System.getenv('SKIP_TESTS') }
test.onlyIf { !System.getenv('SKIP_TESTS') }
This means I can run, for example, SKIP_TESTS=true gradle build
and it won't complain about checkstyle errors.