Skip to content

Commit

Permalink
added Publish code coverage report
Browse files Browse the repository at this point in the history
Signed-off-by: munishchouhan <[email protected]>
  • Loading branch information
munishchouhan committed Oct 2, 2024
1 parent d5723ae commit a464c34
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 24 deletions.
22 changes: 6 additions & 16 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -98,20 +98,10 @@ jobs:
path: |
**/build/reports/tests/test
- name : Add coverage to PR
id : jacoco
uses : madrapps/[email protected]
- name : Publish code coverage report
if: success()
uses : actions/upload-artifact@v4
with :
paths : |
**/build/reports/jacoco/test/jacocoTestReport.xml
token : ${{ secrets.GH_SEQERA_TOKEN }}
min-coverage-overall : 60
min-coverage-changed-files : 60
title : Code Coverage Report
pass-emoji : ':green_circle:'
fail-emoji : ':red_circle:'

- name : Get the Coverage info
run : |
echo "Total coverage ${{ steps.jacoco.outputs.coverage-overall }}"
echo "Changed Files coverage ${{ steps.jacoco.outputs.coverage-changed-files }}"
name : code-coverage-reports-jdk-${{ matrix.java_version }}
path : |
**/build/reports/jacoco/test
10 changes: 2 additions & 8 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -194,6 +194,8 @@ jacoco {
// Code coverage report is always generated after tests run
test { finalizedBy jacocoTestReport }
jacocoTestReport {
// Tests are required to run before generating the code coverage report
dependsOn test
// Remove closure classes from the report, as they are already covered by the enclosing class coverage stats adding only noise.
// See: https://stackoverflow.com/questions/39453696
afterEvaluate {
Expand All @@ -202,11 +204,3 @@ jacocoTestReport {
}))
}
}

jacocoTestReport{
reports {
xml.required = true
csv.required = false
html.outputLocation = layout.buildDirectory.dir('jacocoHtml')
}
}

0 comments on commit a464c34

Please sign in to comment.