From c50f4fef351075810d9a18211a2ef748c1c7493d Mon Sep 17 00:00:00 2001 From: Md Armughanuddin Date: Fri, 1 Sep 2023 23:49:45 +0530 Subject: [PATCH 1/4] Replace Coveralls With Codecov --- .github/workflows/continuous-integration.yml | 12 +++++++++--- build.gradle | 1 - code-coverage-report/build.gradle | 14 -------------- 3 files changed, 9 insertions(+), 18 deletions(-) diff --git a/.github/workflows/continuous-integration.yml b/.github/workflows/continuous-integration.yml index 11bcff71e7..a82c442b66 100644 --- a/.github/workflows/continuous-integration.yml +++ b/.github/workflows/continuous-integration.yml @@ -59,14 +59,20 @@ jobs: arguments: shellcheck if: runner.os == 'Linux' - name: Report jacoco coverage + id: jacoco_report uses: gradle/gradle-build-action@v2 env: ORG_GRADLE_PROJECT_epApiVersion: ${{ matrix.epVersion }} - COVERALLS_REPO_TOKEN: ${{ secrets.COVERALLS_REPO_TOKEN }} with: - arguments: coveralls + arguments: :code-coverage-report:clean codeCoverageReport --no-build-cache continue-on-error: true - if: runner.os == 'Linux' && matrix.java == '11' && matrix.epVersion == '2.21.1' && github.repository == 'uber/NullAway' + if: runner.os == 'Linux' && matrix.java == '11' && matrix.epVersion == '2.21.1' #&& github.repository == 'uber/NullAway' + - name: Upload coverage reports to Codecov + uses: codecov/codecov-action@v3 + with: + token: ${{ secrets.CODECOV_TOKEN }} + files: ./code-coverage-report/build/reports/jacoco/codeCoverageReport/codeCoverageReport.xml + if: steps.jacoco_report.conclusion == 'success' - name: Test publishToMavenLocal flow env: ORG_GRADLE_PROJECT_epApiVersion: ${{ matrix.epVersion }} diff --git a/build.gradle b/build.gradle index db827fa246..704951e51c 100644 --- a/build.gradle +++ b/build.gradle @@ -38,7 +38,6 @@ plugins { id "com.diffplug.spotless" version "6.20.0" id "net.ltgt.errorprone" version "3.1.0" apply false id "com.github.johnrengelman.shadow" version "8.1.1" apply false - id "com.github.kt3k.coveralls" version "2.12.0" apply false id "me.champeau.jmh" version "0.7.1" apply false id "com.github.ben-manes.versions" version "0.47.0" id "com.felipefzdz.gradle.shellcheck" version "1.4.6" diff --git a/code-coverage-report/build.gradle b/code-coverage-report/build.gradle index 9b4f755322..e9d3da6bcd 100644 --- a/code-coverage-report/build.gradle +++ b/code-coverage-report/build.gradle @@ -18,7 +18,6 @@ plugins { id 'java' id 'jacoco' - id 'com.github.kt3k.coveralls' } // Use JDK 17 for this module, via a toolchain. We need JDK 17 since this module @@ -71,19 +70,6 @@ def codeCoverageReport = tasks.register('codeCoverageReport', JacocoReport) { } } -coveralls { - jacocoReportPath = "build/reports/jacoco/codeCoverageReport/codeCoverageReport.xml" - afterEvaluate { - sourceDirs = sourcesPath.incoming.artifactView { lenient(true) }.files as List - } -} - -def coverallsTask = tasks.named('coveralls') - -coverallsTask.configure { - dependsOn 'codeCoverageReport' -} - // These dependencies indicate which projects have tests or tested code we want to include // when computing overall coverage. We aim to measure coverage for all code that actually ships // in a Maven artifact (so, e.g., we do not measure coverage for the jmh module) From 180621b2c5becd30398edf7f27ef84484cb5570b Mon Sep 17 00:00:00 2001 From: Md Armughanuddin Date: Fri, 1 Sep 2023 23:54:18 +0530 Subject: [PATCH 2/4] Added repository check --- .github/workflows/continuous-integration.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/continuous-integration.yml b/.github/workflows/continuous-integration.yml index a82c442b66..2a2232f6a5 100644 --- a/.github/workflows/continuous-integration.yml +++ b/.github/workflows/continuous-integration.yml @@ -66,7 +66,7 @@ jobs: with: arguments: :code-coverage-report:clean codeCoverageReport --no-build-cache continue-on-error: true - if: runner.os == 'Linux' && matrix.java == '11' && matrix.epVersion == '2.21.1' #&& github.repository == 'uber/NullAway' + if: runner.os == 'Linux' && matrix.java == '11' && matrix.epVersion == '2.21.1' && github.repository == 'uber/NullAway' - name: Upload coverage reports to Codecov uses: codecov/codecov-action@v3 with: From 68cf270c2b89c075176c2246014b67e8005d7142 Mon Sep 17 00:00:00 2001 From: Md Armughanuddin Date: Sat, 2 Sep 2023 00:43:12 +0530 Subject: [PATCH 3/4] Updated CI for Codecov Removed token dependency, build cache clean and replaced outcome with conclusion --- .github/workflows/continuous-integration.yml | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/.github/workflows/continuous-integration.yml b/.github/workflows/continuous-integration.yml index 2a2232f6a5..8828cdf07d 100644 --- a/.github/workflows/continuous-integration.yml +++ b/.github/workflows/continuous-integration.yml @@ -64,15 +64,14 @@ jobs: env: ORG_GRADLE_PROJECT_epApiVersion: ${{ matrix.epVersion }} with: - arguments: :code-coverage-report:clean codeCoverageReport --no-build-cache + arguments: codeCoverageReport continue-on-error: true if: runner.os == 'Linux' && matrix.java == '11' && matrix.epVersion == '2.21.1' && github.repository == 'uber/NullAway' - name: Upload coverage reports to Codecov uses: codecov/codecov-action@v3 with: - token: ${{ secrets.CODECOV_TOKEN }} files: ./code-coverage-report/build/reports/jacoco/codeCoverageReport/codeCoverageReport.xml - if: steps.jacoco_report.conclusion == 'success' + if: steps.jacoco_report.outcome == 'success' - name: Test publishToMavenLocal flow env: ORG_GRADLE_PROJECT_epApiVersion: ${{ matrix.epVersion }} From 8582a1e8665d443fcd13c926bc8eb0e8dbce8547 Mon Sep 17 00:00:00 2001 From: Md Armughanuddin <52311490+armughan11@users.noreply.github.com> Date: Sat, 2 Sep 2023 01:01:06 +0530 Subject: [PATCH 4/4] Rename Jacoco Coverage step Co-authored-by: Manu Sridharan --- .github/workflows/continuous-integration.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/continuous-integration.yml b/.github/workflows/continuous-integration.yml index 8828cdf07d..c642b22c03 100644 --- a/.github/workflows/continuous-integration.yml +++ b/.github/workflows/continuous-integration.yml @@ -58,7 +58,7 @@ jobs: with: arguments: shellcheck if: runner.os == 'Linux' - - name: Report jacoco coverage + - name: Aggregate jacoco coverage id: jacoco_report uses: gradle/gradle-build-action@v2 env: