Browse Source

implement coverage report with jacoco

merge-requests/14/merge
Augusto Dwenger 2 years ago
parent
commit
e8fff7b200
  1. 8
      .gitlab-ci.yml
  2. 2
      README.md
  3. 12
      build.gradle.kts

8
.gitlab-ci.yml

@ -32,10 +32,16 @@ unit-test:
artifacts:
expire_in: 3 days
paths:
- build/reports/tests/test/index.html
- build/reports/tests/test/
reports:
junit: build/test-results/test/TEST-*.xml
coverage:
stage: analyse
script:
- "./gradlew $GRADLE_OPTS clean jacocoTestReport"
- "cat build/reports/jacoco/test/html/index.html"
lint:
stage: analyse
script:

2
README.md

@ -1,4 +1,6 @@
# PlayTime
[![pipeline status](https://gitlab.com/hamburghammer/playtime/badges/dev/pipeline.svg)](https://gitlab.com/hamburghammer/playtime/-/commits/dev)
[![coverage report](https://gitlab.com/hamburghammer/playtime/badges/dev/coverage.svg)](https://gitlab.com/hamburghammer/playtime/-/commits/dev)
It's a plugin for a [Spigot](https://www.spigotmc.org) Minecraft server to log the time players spend on the server and returns it to them.

12
build.gradle.kts

@ -3,6 +3,7 @@ plugins {
id("org.jlleitschuh.gradle.ktlint") version "9.0.0"
id("com.github.johnrengelman.shadow") version "5.2.0"
id("org.jetbrains.dokka") version "0.10.0"
jacoco
}
group = "de.augustodwenger"
@ -48,9 +49,20 @@ tasks {
events("skipped", "failed")
// events("passed", "skipped", "failed")
}
extensions.configure(JacocoTaskExtension::class) {
classDumpDir = file("$buildDir/jacoco/classpathdumps")
}
}
dokka {
outputFormat = "html"
outputDirectory = "$buildDir/dokka"
}
jacocoTestReport {
reports {
xml.isEnabled = false
csv.isEnabled = false
html.isEnabled = true
}
dependsOn("test")
}
}
Loading…
Cancel
Save