diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index be85ffc28da..c7d0f9866fb 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -22,10 +22,11 @@ jobs: uses: actions/setup-java@v1 with: java-version: 14 - - name: 'Test' - shell: bash - run: | - ./gradlew --no-parallel build -x distTar -x distTarSource + - uses: burrunan/gradle-cache-action@v1 + name: Test + with: + job-id: jdk14 + arguments: --no-parallel build -x distTar -x distTarSource mac: name: 'macOS (JDK 14)' @@ -38,6 +39,8 @@ jobs: uses: actions/setup-java@v1 with: java-version: 14 - - name: 'Test' - run: | - ./gradlew --no-parallel build -x distTar -x distTarSource -Dskip.test_TestDNSCacheManager.testWithCustomResolverAnd1Server=true + - uses: burrunan/gradle-cache-action@v1 + name: Test + with: + job-id: jdk14 + arguments: --no-parallel build -x distTar -x distTarSource -Dskip.test_TestDNSCacheManager.testWithCustomResolverAnd1Server=true diff --git a/build.gradle.kts b/build.gradle.kts index 4f0c6059b0c..3f40ffd6549 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -506,6 +506,11 @@ allprojects { exceptionFormat = TestExceptionFormat.FULL showStandardStreams = true } + + outputs.cacheIf("test outcomes sometimes depends on third-party systems, so we should not cache it for now") { + false + } + // Pass the property to tests fun passProperty(name: String, default: String? = null) { val value = System.getProperty(name) ?: default diff --git a/gradle.properties b/gradle.properties index 1ce1c6c2161..862fcddf55b 100644 --- a/gradle.properties +++ b/gradle.properties @@ -16,6 +16,10 @@ # org.gradle.parallel=true +# Build cache can be disabled with --no-build-cache option +org.gradle.caching=true +#org.gradle.caching.debug=true + # See https://github.com/gradle/gradle/pull/11358 , https://issues.apache.org/jira/browse/INFRA-14923 # repository.apache.org does not yet support .sha256 and .sha512 checksums systemProp.org.gradle.internal.publish.checksums.insecure=true diff --git a/settings.gradle.kts b/settings.gradle.kts index 77f8f5b2374..ebe5c928abf 100644 --- a/settings.gradle.kts +++ b/settings.gradle.kts @@ -32,6 +32,10 @@ pluginManagement { } } +plugins { + `gradle-enterprise` +} + // This is the name of a current project // Note: it cannot be inferred from the directory name as developer might clone JMeter to jmeter_tmp folder rootProject.name = "jmeter" @@ -92,6 +96,18 @@ if (property("localReleasePlugins").toBool(nullAs = false, blankAs = true, defau includeBuild("../vlsi-release-plugins") } +val isCiServer = System.getenv().containsKey("CI") + +if (isCiServer) { + gradleEnterprise { + buildScan { + termsOfServiceUrl = "https://gradle.com/terms-of-service" + termsOfServiceAgree = "yes" + tag("CI") + } + } +} + // Checksum plugin sources can be validated at https://github.com/vlsi/vlsi-release-plugins buildscript { dependencies { @@ -107,6 +123,8 @@ buildscript { // Note: we need to verify the checksum for checksum-dependency-plugin itself val expectedSha512 = mapOf( + "F7040C571C2A2727F2EED4EA772F5A7C5D9CB393828B7A2331F7167E467429486F5F3E9423883FE9A6D652FFB0484EAE722CDFB46D97180209BCBEEBF9C25DE3" + to "gradle-enterprise-gradle-plugin-3.4.jar", "43BC9061DFDECA0C421EDF4A76E380413920E788EF01751C81BDC004BD28761FBD4A3F23EA9146ECEDF10C0F85B7BE9A857E9D489A95476525565152E0314B5B" to "bcpg-jdk15on-1.62.jar", "2BA6A5DEC9C8DAC2EB427A65815EB3A9ADAF4D42D476B136F37CD57E6D013BF4E9140394ABEEA81E42FBDB8FC59228C7B85C549ED294123BF898A7D048B3BD95"