From e5a9da5f999c56dbfa0d76758b96638eb9bc1915 Mon Sep 17 00:00:00 2001 From: Tim van der Lippe Date: Wed, 17 Jun 2020 21:42:22 +0100 Subject: [PATCH] Move spotless check to separate build task (#1946) This means the tests can run in parallel of the formatting changes. Therefore, formatting changes would not block obtaining your test results, which should hopefully reduce the amount of Travis builds necessary to work on a community PR. This is also in preparation of #1934 which requires spotless to run on JDK11 minimum. --- .travis.yml | 10 +++++++++- settings.gradle.kts | 8 ++++---- 2 files changed, 13 insertions(+), 5 deletions(-) diff --git a/.travis.yml b/.travis.yml index 3ba1dbfa39..394e3e1ed7 100644 --- a/.travis.yml +++ b/.travis.yml @@ -34,8 +34,16 @@ matrix: env: SKIP_RELEASE=true - jdk: openjdk11 env: SKIP_RELEASE=true MOCK_MAKER=mock-maker-inline + # Run Spotless as a separate job on JDK 11 (which is required for google-java-format) + - jdk: openjdk11 + name: "Verify code formatting with Spotless" + script: ./gradlew spotlessCheck + # Do not upload a coverage report, as we don't run the tests for this job + after_success: true - jdk: openjdk8 + name: "Check reproducibility of jars" script: ./check_reproducibility.sh + # Do not upload a coverage report, as we don't run the tests for this job after_success: true branches: @@ -53,7 +61,7 @@ script: # We are using && below on purpose # ciPerformRelease must run only when the entire build has completed # This guarantees that no release steps are executed when the build or tests fail - - ./gradlew spotlessCheck && ./gradlew build idea -s && ./gradlew ciPerformRelease + - ./gradlew build idea -s && ./gradlew ciPerformRelease after_success: #Generates coverage report: diff --git a/settings.gradle.kts b/settings.gradle.kts index be0e981f7f..5ece24a4b3 100644 --- a/settings.gradle.kts +++ b/settings.gradle.kts @@ -1,3 +1,7 @@ +plugins { + id("com.gradle.enterprise").version("3.3.4") +} + include("deprecatedPluginsTest", "inline", "extTest", @@ -34,10 +38,6 @@ rootProject.children.forEach { project -> } } -plugins { - id("com.gradle.enterprise").version("3.3.4") -} - //Posting Build scans to https://scans.gradle.com gradleEnterprise { buildScan {