Skip to content

Commit e5de48c

Browse files
committed
Updated to include Jacoco reports in action and PR; #419
1 parent e7d30f8 commit e5de48c

File tree

1 file changed

+22
-0
lines changed

1 file changed

+22
-0
lines changed

.github/workflows/commitChecks.yml

+22
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,11 @@ on:
88
jobs:
99
Build:
1010
runs-on: ubuntu-latest
11+
12+
# pull-requests write permission needed for Jacoco report in PR comment.
1113
permissions:
1214
contents: read
15+
pull-requests: write
1316

1417
steps:
1518
- uses: actions/checkout@v1
@@ -34,6 +37,25 @@ jobs:
3437
./gradlew build
3538
./gradlew distZip testCodeCoverageReport javadoc
3639
40+
# Add a Jacoco report to the action output using badging tool.
41+
# The badges can be added readily; see a comment in #419.
42+
# However, we have no way to view them in the README.md.
43+
- name: Generate Jacoco coverage report in Action
44+
uses: cicirello/jacoco-badge-generator@v2
45+
with:
46+
jacoco-csv-file: build/reports/jacoco/testCodeCoverageReport/testCodeCoverageReport.csv
47+
48+
# Add coverage report to the pull request as comment.
49+
# Basic coverage checks are implemented.
50+
- name: Add Jacoco coverage report in PR comment
51+
id: jacoco
52+
uses: madrapps/jacoco-report@v1.7.1
53+
with:
54+
paths: build/reports/jacoco/testCodeCoverageReport/testCodeCoverageReport.xml
55+
token: ${{ secrets.GITHUB_TOKEN }}
56+
min-coverage-overall: 50
57+
min-coverage-changed-files: 60
58+
3759
# Confirm the test code inside wres-external-services-tests zip compiles
3860
- name: Compile external-services-tests
3961
run: |

0 commit comments

Comments
 (0)