From ac04c9eda8451a3bf08f496c49a28c3ad086834c Mon Sep 17 00:00:00 2001 From: Janak Amarasena Date: Fri, 12 Jul 2024 16:16:24 +0530 Subject: [PATCH 1/2] Add codecov.yml file --- codecov.yml | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 codecov.yml diff --git a/codecov.yml b/codecov.yml new file mode 100644 index 00000000..eed03af6 --- /dev/null +++ b/codecov.yml @@ -0,0 +1,15 @@ +codecov: + require_ci_to_pass: yes + notify: + wait_for_ci: yes +coverage: + status: + project: # checks the effect for the overall code coverage rate of the repository. + default: + enabled: yes + threshold: null + target: auto + patch: # This status indicates the extent of code coverage achieved by the pull request. + default: + target: 80% + threshold: 50% # With a target of 80% and a threshold of 50%, the acceptable coverage range is 50% to 80%. From 423f4be306c78d9eb8f57da64bafd5dbf572f163 Mon Sep 17 00:00:00 2001 From: Janak Amarasena Date: Fri, 12 Jul 2024 16:16:26 +0530 Subject: [PATCH 2/2] Update GitHub workflow --- .github/workflows/pr-builder.yml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/.github/workflows/pr-builder.yml b/.github/workflows/pr-builder.yml index f03c9267..acb75dd0 100644 --- a/.github/workflows/pr-builder.yml +++ b/.github/workflows/pr-builder.yml @@ -43,3 +43,9 @@ jobs: run: mvn clean install -U -B - name: Delete SNAPSHOT artifacts run: find ~/.m2/repository/ -name "*-SNAPSHOT" -type d -print -prune -exec rm -r {} + +- name: Generate coverage report + run: mvn test jacoco:report + - name: Upload coverage reports to Codecov + uses: codecov/codecov-action@v4.0.1 + with: + token: ${{ secrets.CODECOV_TOKEN }}