Skip to content

A GitHub Action to summarize JaCoCo code coverage in Gradle builds

License

Notifications You must be signed in to change notification settings

jeantessier/code-coverage-summary-action

Use this GitHub action with your project
Add this Action to an existing workflow or create a new one
View on Marketplace

Repository files navigation

code-coverage-summary-action

A GitHub Action to summarize JaCoCo code coverage in Gradle builds

It collects JaCoCo results from each subproject and reports on code coverage for each subproject. The report is a simple table written to the GITHUB_STEP_SUMMARY.

To Use

Here is an example workflow as an example of using this GitHub Action in a job's steps.

jobs:
  build:
    steps:
    - name: Checkout the repo
      uses: actions/checkout@v4

    - name: Set up JDK 17
      uses: actions/setup-java@v4
      with:
        java-version: '17'
        distribution: 'temurin'
    - name: Setup Gradle
      uses: gradle/actions/setup-gradle@v3
    - name: Build with Gradle Wrapper
      run: ./gradlew testCodeCoverageReport

    - name: Summarize tests results
      uses: jeantessier/code-coverage-summary-action@v1

It will produce a summary table like the following.

code-coverage-report

Package Type Coverage Covered Total Missed
default
instruction 0% 0 73 73
line 0% 0 25 25
complexity 0% 0 21 21
method 0% 0 21 21
class 0% 0 10 10
com.jeantessier.classreader
instruction 68% 9768 14252 4484
branch 70% 495 707 212
line 68% 2186 3206 1020
complexity 68% 863 1263 400
method 69% 622 899 277
class 93% 61 65 4
com.jeantessier.classreader.impl
instruction 79% 11407 14301 2894
branch 55% 381 684 303
line 77% 2485 3187 702
complexity 68% 1045 1521 476
method 76% 880 1151 271
class 90% 205 226 21
com.jeantessier.commandline
instruction 82% 1304 1572 268
branch 79% 54 68 14
line 84% 331 393 62
complexity 79% 160 202 42
method 81% 137 168 31
class 100% 18 18 0
com.jeantessier.dependency
instruction 84% 7486 8869 1383
branch 75% 487 645 158
line 85% 1768 2079 311
complexity 76% 798 1043 245
method 81% 582 717 135
class 96% 60 62 2
com.jeantessier.dependencyfinder
instruction 41% 187 447 260
branch 34% 11 32 21
line 42% 56 131 75
complexity 20% 14 67 53
method 27% 14 51 37
class 75% 3 4 1
com.jeantessier.dependencyfinder.ant
instruction 8% 559 6238 5679
branch 15% 68 451 383
line 9% 171 1725 1554
complexity 12% 93 763 670
method 11% 61 537 476
class 23% 3 13 10
com.jeantessier.dependencyfinder.cli
instruction 36% 2344 6425 4081
branch 29% 112 377 265
line 39% 521 1320 799
complexity 35% 161 450 289
method 47% 123 261 138
class 92% 24 26 2
com.jeantessier.dependencyfinder.gui
instruction 0% 0 7143 7143
branch 0% 0 147 147
line 0% 0 1723 1723
complexity 0% 0 288 288
method 0% 0 212 212
class 0% 0 30 30
com.jeantessier.diff
instruction 90% 5452 6013 561
branch 84% 607 722 115
line 90% 1104 1216 112
complexity 76% 497 653 156
method 79% 232 292 60
class 96% 25 26 1
com.jeantessier.metrics
instruction 89% 9621 10739 1118
branch 81% 608 743 135
line 90% 2062 2282 220
complexity 76% 757 991 234
method 80% 459 567 108
class 96% 32 33 1
com.jeantessier.text
instruction 95% 550 573 23
branch 89% 41 46 5
line 97% 135 139 4
complexity 85% 60 70 10
method 89% 42 47 5
class 100% 5 5 0
otherpackage
instruction 0% 0 19 19
line 0% 0 8 8
complexity 0% 0 5 5
method 0% 0 5 5
class 0% 0 3 3
sloc
instruction 0% 0 39 39
branch 0% 0 6 6
line 0% 0 18 18
complexity 0% 0 10 10
method 0% 0 5 5
class 0% 0 3 3
testpackage
instruction 0% 0 50 50
line 0% 0 22 22
complexity 0% 0 11 11
method 0% 0 11 11
class 0% 0 5 5
total
instruction 63% 48678 76753 28075
branch 61% 2864 4628 1764
line 61% 10819 17474 6655
complexity 60% 4448 7358 2910
method 63% 3152 4944 1792
class 82% 436 529 93

About

A GitHub Action to summarize JaCoCo code coverage in Gradle builds

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published