Skip to content

Commit

Permalink
Feat: Enable Jacoco report and Coveralls
Browse files Browse the repository at this point in the history
  • Loading branch information
SeeSharpSoft committed Oct 5, 2024
1 parent 55c8b15 commit 3e801a7
Show file tree
Hide file tree
Showing 2 changed files with 60 additions and 0 deletions.
37 changes: 37 additions & 0 deletions .github/workflows/CoverallsReport.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
# This workflow will build a Java project with Gradle
# For more information see: https://help.github.com/actions/language-and-framework-guides/building-and-testing-java-with-gradle

name: Coveralls Report

on:
push:
branches: [ main ]

jobs:
build:

runs-on: ubuntu-latest

strategy:
fail-fast: false
matrix:
include:
- ideaVersion: 2024.1

steps:
- uses: actions/checkout@v2
- name: Set up JDK 17
uses: actions/setup-java@v2
with:
java-version: '17'
distribution: 'adopt'
- name: Grant execute permission for gradlew
run: chmod +x gradlew
- name: Build with Gradle
env:
IDEA_VERSION: ${{ matrix.ideaVersion }}
run: xvfb-run ./gradlew test
- name: Coveralls
uses: coverallsapp/github-action@v2.3.0
with:
github-token: ${{ secrets.COVERALLS_TOKEN }}
23 changes: 23 additions & 0 deletions build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import org.gradle.internal.impldep.org.testng.reporters.XMLUtils
import org.jetbrains.changelog.Changelog
import org.jetbrains.intellij.platform.gradle.TestFrameworkType
import org.jetbrains.intellij.platform.gradle.extensions.intellijPlatform
Expand All @@ -16,6 +17,8 @@ version = properties("pluginVersion")
plugins {
java
id("idea")
id("jacoco")
id("com.github.kt3k.coveralls") version "2.12.0"
id("org.jetbrains.intellij.platform") version "2.1.0"
id("org.jetbrains.changelog") version "2.2.0"
id("org.jetbrains.grammarkit") version "2022.3.2.2"
Expand Down Expand Up @@ -132,4 +135,24 @@ tasks {
processTestResources {
duplicatesStrategy = DuplicatesStrategy.WARN
}

test {
configure<JacocoTaskExtension> {
isEnabled = true
isIncludeNoLocationClasses = true
excludes = listOf("jdk.internal.*")
}

finalizedBy(jacocoTestReport)
}

jacocoTestReport {
dependsOn(test)
classDirectories.setFrom(instrumentCode)
}

jacocoTestCoverageVerification {
dependsOn(test)
classDirectories.setFrom(instrumentCode)
}
}

0 comments on commit 3e801a7

Please sign in to comment.