2626 # build execution
2727 pull_request :
2828 types : [ labeled, opened, synchronize, reopened ]
29-
29+
3030jobs :
3131 build :
32-
3332 runs-on : ubuntu-latest
3433
3534 steps :
36- - uses : actions/checkout@v4
35+ - name : Checkout Repository
36+ uses : actions/checkout@v4
37+
3738 - name : Set up JDK 11
3839 uses : actions/setup-java@v4
3940 with :
5960
6061 - name : Log coverage percentages to workflow output
6162 run : |
62- echo "(java-11) coverage = ${{ steps.jacoco.outputs.coverage }}"
63- echo "(java-11) branches = ${{ steps.jacoco.outputs.branches }}"
63+ echo "(java-11) coverage = ${{ steps.jacoco.outputs.coverage }}% "
64+ echo "(java-11) branches = ${{ steps.jacoco.outputs.branches }}% "
6465
6566 - name : Upload JaCoCo coverage report
6667 uses : actions/upload-artifact@v4
@@ -81,11 +82,17 @@ jobs:
8182 if : ${{ github.event_name == 'pull_request' }}
8283 run : |
8384 REPORT=$(<.github/badges/coverage-summary_java-11.json)
85+ if [[ -z "$REPORT" ]]; then
86+ echo "Coverage report not found!" >&2
87+ exit 1
88+ fi
89+
8490 COVERAGE=$(jq -r '.coverage' <<< "$REPORT")%
8591 BRANCHES=$(jq -r '.branches' <<< "$REPORT")%
8692 NEWLINE=$'\n'
87- BODY="## JaCoCo Test Coverage Summary Statistics (java-11) ${NEWLINE}* __Coverage:__ ${COVERAGE}${NEWLINE}* __Branches:__ ${BRANCHES}"
88- gh pr comment ${{github.event.pull_request.number}} -b "${BODY}"
93+ BODY="## JaCoCo Test Coverage Summary Statistics (Java 11) ${NEWLINE}* __Coverage:__ ${COVERAGE}${NEWLINE}* __Branches:__ ${BRANCHES}"
94+
95+ gh pr comment ${{ github.event.pull_request.number }} -b "${BODY}"
8996 continue-on-error : true
9097 env :
9198 GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
0 commit comments