Skip to content

Commit

Permalink
Merge pull request #60 from 422404/feature/coverage-reports-aggregation
Browse files Browse the repository at this point in the history
Code coverage reports are now merged together into one
  • Loading branch information
422404 committed Apr 8, 2023
2 parents 765150b + d3d5f1b commit 232b352
Show file tree
Hide file tree
Showing 9 changed files with 70 additions and 49 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/codecov.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,10 @@ jobs:
java-version: 8
- uses: eskatos/gradle-command-action@v2
with:
arguments: test
arguments: testCodeCoverageReport
- uses: codecov/codecov-action@v3
with:
token: ${{ secrets.CODECOV_TOKEN }}
files: ./parser/build/reports/jacoco/report.xml,./interpreter/build/reports/jacoco/report.xml,./actorsystem-servicecontract/build/reports/jacoco/report.xml,./actorsystem-impl/build/reports/jacoco/report.xml
files: ./code-coverage-report/build/reports/jacoco/testCodeCoverageReport/testCodeCoverageReport.xml
name: codecov-actorlang
fail_ci_if_error: true
11 changes: 4 additions & 7 deletions actorsystem-impl/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -14,16 +14,14 @@ repositories {
}

jacoco {
toolVersion = '0.8.7'
toolVersion = '0.8.8'
}

jacocoTestReport {
reports {
xml.enabled = true
xml.destination = file("${buildDir}/reports/jacoco/report.xml")
html.enabled = true
html.destination = file("${buildDir}/reports/jacoco/html")
csv.enabled = false
xml.required = false
csv.required = false
html.outputLocation = file("${buildDir}/reports/jacoco/html")
}
}

Expand All @@ -45,7 +43,6 @@ dependencies {

test {
useJUnitPlatform()
finalizedBy jacocoTestReport
}

compileKotlin {
Expand Down
11 changes: 4 additions & 7 deletions actorsystem-servicecontract/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -14,16 +14,14 @@ repositories {
}

jacoco {
toolVersion = '0.8.7'
toolVersion = '0.8.8'
}

jacocoTestReport {
reports {
xml.enabled = true
xml.destination = file("${buildDir}/reports/jacoco/report.xml")
html.enabled = true
html.destination = file("${buildDir}/reports/jacoco/html")
csv.enabled = false
xml.required = false
csv.required = false
html.outputLocation = file("${buildDir}/reports/jacoco/html")
}
}

Expand All @@ -41,7 +39,6 @@ dependencies {

test {
useJUnitPlatform()
finalizedBy jacocoTestReport
}

compileKotlin {
Expand Down
11 changes: 4 additions & 7 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -20,16 +20,14 @@ application {
}

jacoco {
toolVersion = '0.8.7'
toolVersion = '0.8.8'
}

jacocoTestReport {
reports {
xml.enabled = true
xml.destination = file("${buildDir}/reports/jacoco/report.xml")
html.enabled = true
html.destination = file("${buildDir}/reports/jacoco/html")
csv.enabled = false
xml.required = false
csv.required = false
html.outputLocation = file("${buildDir}/reports/jacoco/html")
}
}

Expand All @@ -55,7 +53,6 @@ dependencies {

test {
useJUnitPlatform()
finalizedBy jacocoTestReport
}

compileKotlin {
Expand Down
38 changes: 38 additions & 0 deletions code-coverage-report/build.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
plugins {
id 'base'
id 'jacoco-report-aggregation'
}

repositories {
mavenCentral()
}

dependencies {
jacocoAggregation project(':parser')
jacocoAggregation project(':actorsystem-servicecontract')
jacocoAggregation project(':actorsystem-impl')
jacocoAggregation project(':interpreter')
}

reporting {
reports {
testCodeCoverageReport(JacocoCoverageReport) {
testType = TestSuiteType.UNIT_TEST
}
}
}

tasks.named('check') {
dependsOn tasks.named('testCodeCoverageReport', JacocoReport)
}

testCodeCoverageReport {
afterEvaluate {
classDirectories.setFrom(files(classDirectories.files.collect {
fileTree(dir: it, exclude: [
// We exclude the parser Java generated sources
"org/actorlang/antlr/gen/*"
])
}))
}
}
2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-6.8-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.0-bin.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
11 changes: 4 additions & 7 deletions interpreter/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -14,16 +14,14 @@ repositories {
}

jacoco {
toolVersion = '0.8.7'
toolVersion = '0.8.8'
}

jacocoTestReport {
reports {
xml.enabled = true
xml.destination = file("${buildDir}/reports/jacoco/report.xml")
html.enabled = true
html.destination = file("${buildDir}/reports/jacoco/html")
csv.enabled = false
xml.required = false
csv.required = false
html.outputLocation = file("${buildDir}/reports/jacoco/html")
}
}

Expand All @@ -47,7 +45,6 @@ dependencies {

test {
useJUnitPlatform()
finalizedBy jacocoTestReport
}
compileKotlin {
kotlinOptions.jvmTarget = '1.8'
Expand Down
30 changes: 12 additions & 18 deletions parser/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -14,30 +14,20 @@ repositories {
mavenCentral()
}

jacoco {
toolVersion = '0.8.8'
}

generateGrammarSource {
arguments += ["-visitor", "-long-messages"]
outputDirectory = file("src/main/java/")
}

jacoco {
toolVersion = '0.8.7'
}

jacocoTestReport {
reports {
xml.enabled = true
xml.destination = file("${buildDir}/reports/jacoco/report.xml")
html.enabled = true
html.destination = file("${buildDir}/reports/jacoco/html")
csv.enabled = false
}

afterEvaluate {
classDirectories.setFrom(files(classDirectories.files.collect {
fileTree(dir: it, exclude: [
"org/actorlang/antlr/gen/*"
])
}))
xml.required = false
csv.required = false
html.outputLocation = file("${buildDir}/reports/jacoco/html")
}
}

Expand All @@ -56,13 +46,17 @@ dependencies {

test {
useJUnitPlatform()
finalizedBy jacocoTestReport
}

compileKotlin {
kotlinOptions.jvmTarget = '1.8'
dependsOn generateGrammarSource
}

compileTestKotlin {
kotlinOptions.jvmTarget = '1.8'
}

runKtlintCheckOverMainSourceSet {
dependsOn generateGrammarSource
}
1 change: 1 addition & 0 deletions settings.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,4 @@ include 'parser'
include 'actorsystem-servicecontract'
include 'actorsystem-impl'
include 'interpreter'
include 'code-coverage-report'

0 comments on commit 232b352

Please sign in to comment.