From ab094ef04d489323ef802e0cbe3a23cfb0751aa7 Mon Sep 17 00:00:00 2001 From: Piotr Idzik <65706193+vil02@users.noreply.github.com> Date: Sat, 6 Apr 2024 17:06:30 +0200 Subject: [PATCH] chore: generate coverage report and upload it to codecov (#5098) --- .github/workflows/build.yml | 9 +++++++++ pom.xml | 26 ++++++++++++++++++++++++-- 2 files changed, 33 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index e725dfa74..5b617a86d 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -1,5 +1,9 @@ name: Build on: [push, pull_request] + +env: + COVERAGE_REPORT_PATH: "target/site/jacoco/jacoco.xml" + jobs: build: runs-on: ubuntu-latest @@ -12,3 +16,8 @@ jobs: distribution: 'adopt' - name: Build with Maven run: mvn --batch-mode --update-snapshots verify + - name: Upload coverage to codecov + uses: codecov/codecov-action@v3 + with: + files: "${{ env.REPORT_NAME }}" + fail_ci_if_error: true diff --git a/pom.xml b/pom.xml index 86922e1f0..23f90f682 100644 --- a/pom.xml +++ b/pom.xml @@ -63,7 +63,10 @@ maven-surefire-plugin - 2.22.2 + 3.2.5 + + + org.apache.maven.plugins @@ -74,6 +77,25 @@ 17 + + org.jacoco + jacoco-maven-plugin + 0.8.12 + + + + prepare-agent + + + + generate-code-coverage-report + test + + report + + + + - \ No newline at end of file +