Skip to content

Commit

Permalink
Kover reporting
Browse files Browse the repository at this point in the history
  • Loading branch information
GregHib committed Jan 22, 2024
1 parent 0a518a8 commit 52b1b6a
Show file tree
Hide file tree
Showing 3 changed files with 40 additions and 13 deletions.
20 changes: 18 additions & 2 deletions .github/workflows/run_unit_tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,27 @@ jobs:
cache: 'gradle'
- name: Validate Gradle wrapper
uses: gradle/wrapper-validation-action@v1
- run: ls
- name: Grant Permissions to gradlew
run: chmod +x gradlew
- name: Run Gradle build and run tests
uses: gradle/gradle-build-action@v2
with:
gradle-version: 8.5
- run: ./gradlew test
- run: ./gradlew koverXmlReport
- name: Add coverage report to PR
id: kover
uses: mi-kas/kover-report@v1
with:
path: |
${{ github.workspace }}/buffer/build/reports/kover/report.xml
${{ github.workspace }}/cache/build/reports/kover/report.xml
${{ github.workspace }}/engine/build/reports/kover/report.xml
${{ github.workspace }}/game/build/reports/kover/report.xml
${{ github.workspace }}/network/build/reports/kover/report.xml
${{ github.workspace }}/types/build/reports/kover/report.xml
${{ github.workspace }}/yaml/build/reports/kover/report.xml
title: Code Coverage
update-comment: true
min-coverage-overall: 80
min-coverage-changed-files: 80
coverage-counter-type: LINE
27 changes: 18 additions & 9 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ allprojects {
apply(plugin = "kotlin")
apply(plugin = "idea")
apply(plugin = "org.jetbrains.kotlin.jvm")
apply(plugin = "org.jetbrains.kotlinx.kover")

group = "world.gregs.void"
version = "1.0.0"
Expand All @@ -27,6 +28,7 @@ allprojects {
dependencies {
implementation(kotlin("stdlib-jdk8"))
testImplementation("org.junit.jupiter:junit-jupiter-api:${findProperty("junitVersion")}")
testImplementation("org.junit.jupiter:junit-jupiter-engine:${findProperty("junitVersion")}")
}

tasks {
Expand All @@ -39,22 +41,29 @@ allprojects {
kotlinOptions.jvmTarget = JavaVersion.VERSION_19.toString()
kotlinOptions.freeCompilerArgs = listOf("-Xinline-classes", "-Xcontext-receivers", "-Xjvm-default=all-compatibility")
}
test {
useJUnitPlatform()
failFast = true
}
tasks.test {
minHeapSize = "512m"
maxHeapSize = "4096m"
useJUnitPlatform()
failFast = true
testLogging {
events("passed", "skipped", "failed")
}
}

}

kover {
useJacoco()
}

koverReport {
filters {
includes {
classes("world.gregs.voidps")
classes("world.gregs.voidps.*")
}
excludes {
classes("world.gregs.voidps.tools.*")
}
}
}

kover {
useJacoco()
}
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,15 @@ import io.mockk.mockk
import org.junit.Ignore
import org.junit.jupiter.api.Assertions.assertEquals
import org.junit.jupiter.api.BeforeEach
import org.junit.jupiter.api.Disabled
import org.junit.jupiter.api.Test
import world.gregs.voidps.type.Direction
import world.gregs.voidps.engine.entity.obj.GameObject
import world.gregs.voidps.type.Tile
import world.gregs.voidps.engine.map.collision.Collisions
import world.gregs.voidps.type.Direction
import world.gregs.voidps.type.Tile

@Ignore
@Disabled
internal class MapGraphTest {

private lateinit var strategy: TileTraversalStrategy
Expand Down

0 comments on commit 52b1b6a

Please sign in to comment.