Skip to content

Commit 3e801a7

Browse files
committed
Feat: Enable Jacoco report and Coveralls
1 parent 55c8b15 commit 3e801a7

File tree

2 files changed

+60
-0
lines changed

2 files changed

+60
-0
lines changed
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
# This workflow will build a Java project with Gradle
2+
# For more information see: https://help.github.com/actions/language-and-framework-guides/building-and-testing-java-with-gradle
3+
4+
name: Coveralls Report
5+
6+
on:
7+
push:
8+
branches: [ main ]
9+
10+
jobs:
11+
build:
12+
13+
runs-on: ubuntu-latest
14+
15+
strategy:
16+
fail-fast: false
17+
matrix:
18+
include:
19+
- ideaVersion: 2024.1
20+
21+
steps:
22+
- uses: actions/checkout@v2
23+
- name: Set up JDK 17
24+
uses: actions/setup-java@v2
25+
with:
26+
java-version: '17'
27+
distribution: 'adopt'
28+
- name: Grant execute permission for gradlew
29+
run: chmod +x gradlew
30+
- name: Build with Gradle
31+
env:
32+
IDEA_VERSION: ${{ matrix.ideaVersion }}
33+
run: xvfb-run ./gradlew test
34+
- name: Coveralls
35+
uses: coverallsapp/[email protected]
36+
with:
37+
github-token: ${{ secrets.COVERALLS_TOKEN }}

build.gradle.kts

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import org.gradle.internal.impldep.org.testng.reporters.XMLUtils
12
import org.jetbrains.changelog.Changelog
23
import org.jetbrains.intellij.platform.gradle.TestFrameworkType
34
import org.jetbrains.intellij.platform.gradle.extensions.intellijPlatform
@@ -16,6 +17,8 @@ version = properties("pluginVersion")
1617
plugins {
1718
java
1819
id("idea")
20+
id("jacoco")
21+
id("com.github.kt3k.coveralls") version "2.12.0"
1922
id("org.jetbrains.intellij.platform") version "2.1.0"
2023
id("org.jetbrains.changelog") version "2.2.0"
2124
id("org.jetbrains.grammarkit") version "2022.3.2.2"
@@ -132,4 +135,24 @@ tasks {
132135
processTestResources {
133136
duplicatesStrategy = DuplicatesStrategy.WARN
134137
}
138+
139+
test {
140+
configure<JacocoTaskExtension> {
141+
isEnabled = true
142+
isIncludeNoLocationClasses = true
143+
excludes = listOf("jdk.internal.*")
144+
}
145+
146+
finalizedBy(jacocoTestReport)
147+
}
148+
149+
jacocoTestReport {
150+
dependsOn(test)
151+
classDirectories.setFrom(instrumentCode)
152+
}
153+
154+
jacocoTestCoverageVerification {
155+
dependsOn(test)
156+
classDirectories.setFrom(instrumentCode)
157+
}
135158
}

0 commit comments

Comments
 (0)