Skip to content

Commit

Permalink
Re enable coverage
Browse files Browse the repository at this point in the history
  • Loading branch information
etiennebrateau authored and SingingBush committed Aug 13, 2024
1 parent 426e5be commit 9b001c9
Show file tree
Hide file tree
Showing 9 changed files with 35 additions and 18 deletions.
11 changes: 5 additions & 6 deletions .github/workflows/coverage.yml
Original file line number Diff line number Diff line change
@@ -1,17 +1,16 @@
name: Test Coverage

##
## Run cobertura task and publish test coverage report to coverall.io
## Run kover task and publish test coverage report to coverall.io
##

on:
# Trigger the workflow on push or pull request,
# but only for the master and develop branches
push:
branches:
- dont_run
# - master
# - develop ## disable coverage on develop branch until cobertura supports Gradle 7: https://github.com/stevesaliman/gradle-cobertura-plugin/pull/178
- master
- develop

jobs:
build:
Expand All @@ -26,7 +25,7 @@ jobs:
distribution: temurin
java-version: 21

- name: Cobertura coveralls.io
run: ./gradlew cobertura coveralls
- name: Kover coveralls.io
run: ./gradlew koverXmlReport coveralls
env:
COVERALLS_REPO_TOKEN: ${{ secrets.COVERALLS_REPO_TOKEN }}
8 changes: 1 addition & 7 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -16,20 +16,14 @@ plugins {
alias(libs.plugins.gradleIntelliJModule)
alias(libs.plugins.gradleIntelliJPlatform).apply(false) // required to prevent resolution error
alias(libs.plugins.grammarkit)
// id("net.saliman.cobertura") version "4.0.0"
// id("com.github.kt3k.coveralls") version "2.10.2"
alias(libs.plugins.kover)
}

val ideaVersion = properties("ideaVersion")

// When testing, set to "true" if you want to have expected data written (to easily update lexer/parser tests)
val overrideTestData = "false"

// cobertura.coverageFormats = ["html", "xml"] // coveralls plugin depends on xml format report
// cobertura.coverageSourceDirs = [sourceSets.main.java.srcDirs, sourceSets.main.kotlin.srcDirs, "gen"]
// cobertura.coverageEncoding = "UTF-8"
// cobertura.coverageExcludes = [ ".*uk.co.cwspencer.*" ]

allprojects {
tasks {
withType<JavaCompile> {
Expand Down
10 changes: 10 additions & 0 deletions debugger/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,18 @@ import org.jetbrains.intellij.platform.gradle.TestFrameworkType
plugins {
id("java")
alias(libs.plugins.gradleIntelliJModule)
alias(libs.plugins.kover)
}

kover {
reports {
filters {
excludes {
classes.add("uk.co.cwspencer.*")
}
}
}
}

repositories {
mavenCentral()
Expand Down
16 changes: 11 additions & 5 deletions dlang/plugin-impl/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,11 @@ plugins {
id("org.gradle.idea")
id("java")
alias(libs.plugins.gradleIntelliJPlatform)
alias(libs.plugins.kover)
alias(libs.plugins.coveralls)
}

// cobertura.coverageFormats = ["html", "xml"] // coveralls plugin depends on xml format report
// cobertura.coverageSourceDirs = [sourceSets.main.java.srcDirs, sourceSets.main.kotlin.srcDirs, "gen"]
// cobertura.coverageEncoding = "UTF-8"
// cobertura.coverageExcludes = [ ".*uk.co.cwspencer.*" ]

coveralls.jacocoReportPath = "build/reports/kover/report.xml"

repositories {
mavenCentral()
Expand Down Expand Up @@ -88,4 +86,12 @@ dependencies {
zipSigner()
instrumentationTools()
}

// theses kover lines are here to generate a merged report of all the projects
kover(project(":"))
kover(project(":utils"))
kover(project(":errorreporting"))
kover(project(":debugger"))
kover(project(":sdlang"))
kover(project(":dub"))
}
1 change: 1 addition & 0 deletions dub/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ plugins {
id("java")
alias(libs.plugins.kotlin)
alias(libs.plugins.gradleIntelliJModule)
alias(libs.plugins.kover)
}

repositories {
Expand Down
1 change: 1 addition & 0 deletions errorreporting/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ plugins {
id("java")
alias(libs.plugins.kotlin)
alias(libs.plugins.gradleIntelliJModule)
alias(libs.plugins.kover)
}


Expand Down
4 changes: 4 additions & 0 deletions gradle/libs.versions.toml
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,16 @@ sentry = "7+"
gradleIntelliJPlatformPlugin = "2.0.1"
grammarkit = "2022.3.2.2"
kotlin = "1.9.+"
kover = "0.8.2"
coveralls = "2.12.2"

[plugins]
gradleIntelliJPlatform = { id = "org.jetbrains.intellij.platform", version.ref = "gradleIntelliJPlatformPlugin" }
gradleIntelliJModule = { id = "org.jetbrains.intellij.platform.module", version.ref = "gradleIntelliJPlatformPlugin" }
grammarkit = { id = "org.jetbrains.grammarkit", version.ref = "grammarkit" }
kotlin = { id = "org.jetbrains.kotlin.jvm", version.ref = "kotlin" }
kover = { id = "org.jetbrains.kotlinx.kover", version.ref = "kover" }
coveralls = { id = "com.github.kt3k.coveralls", version.ref = "coveralls" }

[libraries]
annotations = { group = "org.jetbrains", name = "annotations", version.ref = "annotations" }
Expand Down
1 change: 1 addition & 0 deletions sdlang/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ plugins {
alias(libs.plugins.kotlin)
alias(libs.plugins.grammarkit)
alias(libs.plugins.gradleIntelliJModule)
alias(libs.plugins.kover)
}


Expand Down
1 change: 1 addition & 0 deletions utils/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ plugins {
id("java")
alias(libs.plugins.kotlin)
alias(libs.plugins.gradleIntelliJModule)
alias(libs.plugins.kover)
}


Expand Down

0 comments on commit 9b001c9

Please sign in to comment.