Skip to content

Commit

Permalink
Merge branch 'master' into 314-update-to-micronaut-41
Browse files Browse the repository at this point in the history
  • Loading branch information
munishchouhan authored Oct 2, 2024
2 parents 65cbf3d + 8f3de2a commit 19587a9
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 0 deletions.
8 changes: 8 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -97,3 +97,11 @@ jobs:
name: test-reports-jdk-${{ matrix.java_version }}
path: |
**/build/reports/tests/test
- name : Publish code coverage report
if: success()
uses : actions/upload-artifact@v4
with :
name : code-coverage-reports-jdk-${{ matrix.java_version }}
path : |
**/build/reports/jacoco/test
21 changes: 21 additions & 0 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ plugins {
id "io.micronaut.minimal.application" version "4.1.1"
id "com.google.cloud.tools.jib" version "3.4.2"
id 'org.asciidoctor.jvm.convert' version '3.3.2'
id 'jacoco'
}

String gitVersion() {
Expand Down Expand Up @@ -186,3 +187,23 @@ task buildInfo { doLast {
buildInfo.dependsOn processResources
compileGroovy.dependsOn buildInfo

jacoco {
toolVersion '0.8.12'
}
/**
* Code coverage with JaCoCo.
* See: https://www.jacoco.org/; https://docs.gradle.org/current/userguide/jacoco_plugin.html
*/
// 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 {
classDirectories.setFrom(files(classDirectories.files.collect { dir ->
fileTree(dir: dir, excludes: ['**/*$*_closure*'])
}))
}
}

0 comments on commit 19587a9

Please sign in to comment.