From 077084f511dfb5949f329998df47704c81ccd4e0 Mon Sep 17 00:00:00 2001 From: bfisher Date: Tue, 28 Apr 2020 18:51:48 +0100 Subject: [PATCH 1/5] Added stage to pipeline for codecov --- .github/workflows/master.yml | 7 +++++++ gradle/unit-test.gradle | 6 +----- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/.github/workflows/master.yml b/.github/workflows/master.yml index 5bdfc04..5bb92bd 100644 --- a/.github/workflows/master.yml +++ b/.github/workflows/master.yml @@ -44,6 +44,13 @@ jobs: env: SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + - name: Upload coverage to Codecov + uses: codecov/codecov-action@v1 + with: + token: ${{ secrets.CODECOV_TOKEN }} + file: ./build/reports/jacoco/test/jacocoUnitTestReport.xml + flags: unittests + name: codecov-umbrella # Package and Functional Tests diff --git a/gradle/unit-test.gradle b/gradle/unit-test.gradle index af98ec3..e7c77d2 100644 --- a/gradle/unit-test.gradle +++ b/gradle/unit-test.gradle @@ -4,10 +4,6 @@ test { testLogging { events "passed", "skipped", "failed" } - - jacoco { - excludes = ['**/MainApplication*'] - } } jacocoTestReport { @@ -20,4 +16,4 @@ jacocoTestReport { } } -jacocoTestReport.dependsOn test \ No newline at end of file +test.finalizedBy jacocoTestReport \ No newline at end of file From 3b820c953b03143f197ddc7859ad7b067ec3a445 Mon Sep 17 00:00:00 2001 From: bfisher Date: Tue, 28 Apr 2020 19:01:08 +0100 Subject: [PATCH 2/5] Updated pipeline to use gradle test --- .github/workflows/master.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/master.yml b/.github/workflows/master.yml index 5bb92bd..24a4aec 100644 --- a/.github/workflows/master.yml +++ b/.github/workflows/master.yml @@ -38,7 +38,7 @@ jobs: - name: Grant execute permission for gradlew run: chmod +x gradlew - name: Test with Coverage - run: ./gradlew jacocoTestReport + run: ./gradlew test - name: Analysis with SonarCloud run: ./gradlew sonarqube env: From 90ff261dd7559864e46cdb6a349859860f9226fa Mon Sep 17 00:00:00 2001 From: bfisher Date: Tue, 28 Apr 2020 19:05:17 +0100 Subject: [PATCH 3/5] Corrected spelling mistake in workflows --- .github/workflows/master.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/master.yml b/.github/workflows/master.yml index 24a4aec..7735931 100644 --- a/.github/workflows/master.yml +++ b/.github/workflows/master.yml @@ -48,7 +48,7 @@ jobs: uses: codecov/codecov-action@v1 with: token: ${{ secrets.CODECOV_TOKEN }} - file: ./build/reports/jacoco/test/jacocoUnitTestReport.xml + file: ./build/reports/jacoco/test/jacocoTestReport.xml flags: unittests name: codecov-umbrella From 71c5fd6e448f46d6691f71d335d468868611fa5c Mon Sep 17 00:00:00 2001 From: bfisher Date: Tue, 28 Apr 2020 19:17:19 +0100 Subject: [PATCH 4/5] Updated CodeCov badge --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index fe5d213..e79b2d9 100644 --- a/README.md +++ b/README.md @@ -6,7 +6,7 @@ ## CodeCov Overall -[![codecov](https://codecov.io/gh/fishey2/java-component-template/branch/master/graph/badge.svg?token=BuPjnBJ5YK)](https://codecov.io/gh/fishey2/java-component-template) +[![codecov](https://codecov.io/gh/fishey2/java-component-template/branch/with_codecov/graph/badge.svg)](https://codecov.io/gh/fishey2/java-component-template) ## SonarCloud Overall [![Quality Gate Status](https://sonarcloud.io/api/project_badges/measure?project=fishey2_java-component-template&metric=alert_status)](https://sonarcloud.io/dashboard?id=fishey2_java-component-template) From a21685ca965fbae07e2853314c3a6a90894a9287 Mon Sep 17 00:00:00 2001 From: bfisher Date: Wed, 23 Sep 2020 09:08:11 +0100 Subject: [PATCH 5/5] [#3] Re-add CodeCov in pipeline after master merge --- .github/workflows/master.yml | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/.github/workflows/master.yml b/.github/workflows/master.yml index a756df6..a92c716 100644 --- a/.github/workflows/master.yml +++ b/.github/workflows/master.yml @@ -46,6 +46,13 @@ jobs: env: SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + - name: Upload coverage to Codecov + uses: codecov/codecov-action@v1 + with: + token: ${{ secrets.CODECOV_TOKEN }} + file: ./build/reports/jacoco/test/jacocoTestReport.xml + flags: unittests + name: codecov-umbrella - name: Functional Tests run: make testFunctional