From 4403a124b59c08039a369df126e44340f1fa3668 Mon Sep 17 00:00:00 2001 From: Andrew Mains Date: Sun, 5 Jun 2022 16:46:28 -0400 Subject: [PATCH 1/7] Test github actions for CI --- .github/workflows/gradle.yml | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) create mode 100644 .github/workflows/gradle.yml diff --git a/.github/workflows/gradle.yml b/.github/workflows/gradle.yml new file mode 100644 index 0000000..7d9f528 --- /dev/null +++ b/.github/workflows/gradle.yml @@ -0,0 +1,34 @@ +# This workflow uses actions that are not certified by GitHub. +# They are provided by a third-party and are governed by +# separate terms of service, privacy policy, and support +# documentation. +# This workflow will build a Java project with Gradle and cache/restore any dependencies to improve the workflow execution time +# For more information see: https://help.github.com/actions/language-and-framework-guides/building-and-testing-java-with-gradle + +name: Java CI with Gradle + +on: + push: + branches: [ "master" ] + pull_request: + branches: [ "master" ] + +permissions: + contents: read + +jobs: + build: + + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v3 + - name: Set up JDK 11 + uses: actions/setup-java@v3 + with: + java-version: '11' + distribution: 'temurin' + - name: Build with Gradle + uses: gradle/gradle-build-action@0d13054264b0bb894ded474f08ebb30921341cee + with: + arguments: build From 123165b17fc16932aa3e754e1e577d4949ffbd89 Mon Sep 17 00:00:00 2001 From: Andrew Mains Date: Sun, 5 Jun 2022 16:47:55 -0400 Subject: [PATCH 2/7] Update gradle.yml --- .github/workflows/gradle.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/gradle.yml b/.github/workflows/gradle.yml index 7d9f528..b310a3b 100644 --- a/.github/workflows/gradle.yml +++ b/.github/workflows/gradle.yml @@ -23,10 +23,10 @@ jobs: steps: - uses: actions/checkout@v3 - - name: Set up JDK 11 + - name: Set up JDK 8 uses: actions/setup-java@v3 with: - java-version: '11' + java-version: '8' distribution: 'temurin' - name: Build with Gradle uses: gradle/gradle-build-action@0d13054264b0bb894ded474f08ebb30921341cee From c479da38f449c1b44c8233cdcaf817fd83473ed7 Mon Sep 17 00:00:00 2001 From: Andrew Mains Date: Sun, 5 Jun 2022 17:02:16 -0400 Subject: [PATCH 3/7] Add junit reporting EnricoMi/publish-unit-test-result-action@v1 --- .github/workflows/gradle.yml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/.github/workflows/gradle.yml b/.github/workflows/gradle.yml index b310a3b..ba7231e 100644 --- a/.github/workflows/gradle.yml +++ b/.github/workflows/gradle.yml @@ -32,3 +32,8 @@ jobs: uses: gradle/gradle-build-action@0d13054264b0bb894ded474f08ebb30921341cee with: arguments: build + - name: Publish Test Results + uses: EnricoMi/publish-unit-test-result-action@v1 + if: always() + with: + files: "test-results/**/*.xml" From c5fe6f56330d020247263a0166813d7ecfc22a15 Mon Sep 17 00:00:00 2001 From: Andrew Mains Date: Sun, 5 Jun 2022 16:25:36 -0400 Subject: [PATCH 4/7] Upgrade gradle version to 6.9.2 Notes: cant go to 7.x just yet; we have some deprecated things to fix up. Doing this step wise. --- build.gradle | 11 ++++++----- gradle/wrapper/gradle-wrapper.properties | 2 +- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/build.gradle b/build.gradle index a92047a..87a71d8 100644 --- a/build.gradle +++ b/build.gradle @@ -169,9 +169,10 @@ subprojects { ext."signing.secretKeyRingFile" = "ci/${ext.secretKeyRingFileName}" -task wrapper(type: Wrapper) { + +wrapper { // Gradle version 4+ required for JMH benchmarking, otherwise v3.5+ is sufficient - gradleVersion = '4.0' + gradleVersion = '6.9' } // -------------------------------------- @@ -183,9 +184,9 @@ coveralls { task jacocoRootReport(type: org.gradle.testing.jacoco.tasks.JacocoReport) { dependsOn = subprojects.test - sourceDirectories = files(subprojects.sourceSets.main.allSource.srcDirs) - classDirectories = files(subprojects.sourceSets.main.output.classesDirs) - executionData = files(subprojects.jacocoTestReport.executionData) + sourceDirectories.setFrom(files(subprojects.sourceSets.main.allSource.srcDirs)) + classDirectories.setFrom(files(subprojects.sourceSets.main.output.classesDirs)) + executionData.setFrom(files(subprojects.jacocoTestReport.executionData)) reports { xml.enabled = true diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index de80b9b..0161e9e 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -1,5 +1,5 @@ #Fri Dec 25 03:30:51 CET 2020 -distributionUrl=https\://services.gradle.org/distributions/gradle-4.0-all.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-6.9.2-all.zip distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists zipStorePath=wrapper/dists From eed7f6ae872e243dafc5168da9ef11718dbfc12c Mon Sep 17 00:00:00 2001 From: Andrew Mains Date: Sun, 5 Jun 2022 16:50:18 -0400 Subject: [PATCH 5/7] WIP: fail test --- core/src/test/java/com/uber/m3/tally/BucketPairImplTest.java | 1 + 1 file changed, 1 insertion(+) diff --git a/core/src/test/java/com/uber/m3/tally/BucketPairImplTest.java b/core/src/test/java/com/uber/m3/tally/BucketPairImplTest.java index 3224729..f497a67 100644 --- a/core/src/test/java/com/uber/m3/tally/BucketPairImplTest.java +++ b/core/src/test/java/com/uber/m3/tally/BucketPairImplTest.java @@ -73,6 +73,7 @@ public void bucketPairs() { expectedPairs, BucketPairImpl.bucketPairs(ValueBuckets.linear(0, 50, 3)) ); + throw new RuntimeException("amainsd: intentional"); } @Test From 3f04ea63970ea2c0b55f9fa919613e96c5b97d35 Mon Sep 17 00:00:00 2001 From: Sokol Andrey <2789641+SokolAndrey@users.noreply.github.com> Date: Thu, 21 Dec 2023 17:08:49 -0500 Subject: [PATCH 6/7] Remove action to publish test results --- .github/workflows/gradle.yml | 5 ----- 1 file changed, 5 deletions(-) diff --git a/.github/workflows/gradle.yml b/.github/workflows/gradle.yml index 2bf70bb..adb82ec 100644 --- a/.github/workflows/gradle.yml +++ b/.github/workflows/gradle.yml @@ -32,8 +32,3 @@ jobs: uses: gradle/gradle-build-action@0d13054264b0bb894ded474f08ebb30921341cee with: arguments: build - - name: Publish Test Results - uses: EnricoMi/publish-unit-test-result-action@v1 - if: always() - with: - files: "test-results/**/*.xml" From fcf4d5f3627d19dc74e513ddf6f50a7a02cdd416 Mon Sep 17 00:00:00 2001 From: Sokol Andrey <2789641+SokolAndrey@users.noreply.github.com> Date: Thu, 21 Dec 2023 17:11:13 -0500 Subject: [PATCH 7/7] Remove failing test Confirmed that it fails the CI --- core/src/test/java/com/uber/m3/tally/BucketPairImplTest.java | 1 - 1 file changed, 1 deletion(-) diff --git a/core/src/test/java/com/uber/m3/tally/BucketPairImplTest.java b/core/src/test/java/com/uber/m3/tally/BucketPairImplTest.java index f497a67..3224729 100644 --- a/core/src/test/java/com/uber/m3/tally/BucketPairImplTest.java +++ b/core/src/test/java/com/uber/m3/tally/BucketPairImplTest.java @@ -73,7 +73,6 @@ public void bucketPairs() { expectedPairs, BucketPairImpl.bucketPairs(ValueBuckets.linear(0, 50, 3)) ); - throw new RuntimeException("amainsd: intentional"); } @Test