diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index a00943822a..e717ae941f 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -55,12 +55,9 @@ jobs: GITHUB_USER: ${{ github.actor }} GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - name: 'Test' - env: - COVERALLS_REPO_TOKEN: ${{ secrets.COVERALLS_REPO_TOKEN }} - if: ${{ env.COVERALLS_REPO_TOKEN }} - run: ./gradlew test jacocoTestReport coveralls - - name: 'Game Test' - run: ./gradlew runGameTestServer -x :loader-forge:downloadAssets + run: ./gradlew test runGameTestServer jacocoTestReport -x :loader-forge:downloadAssets + - name: 'Submit coverage results' + uses: coverallsapp/github-action@v2 - name: 'Deploy as GitHub CI artifacts' uses: actions/upload-artifact@v4 with: diff --git a/build.gradle b/build.gradle index 920ff9670b..45ee5ced5e 100644 --- a/build.gradle +++ b/build.gradle @@ -1,6 +1,5 @@ plugins { id 'net.darkhax.curseforgegradle' version '1.0.8' apply false - id 'com.github.kt3k.coveralls' version '2.12.0' apply false id 'com.diffplug.spotless' version '6.25.0' apply false id 'com.modrinth.minotaur' version '2.+' apply false diff --git a/buildSrc/src/main/groovy/multiloader-common.gradle b/buildSrc/src/main/groovy/multiloader-common.gradle index 78885d894b..c7c77974c2 100644 --- a/buildSrc/src/main/groovy/multiloader-common.gradle +++ b/buildSrc/src/main/groovy/multiloader-common.gradle @@ -4,7 +4,6 @@ plugins { id 'java-library' id 'maven-publish' id 'jacoco' - id 'com.github.kt3k.coveralls' id 'com.diffplug.spotless' } @@ -291,6 +290,11 @@ tasks.configureEach { task -> } } +javadoc { + // prevent java 8's strict doclint for javadocs from failing builds + options.addStringOption('Xdoclint:accessibility,html,reference,syntax', '-quiet') +} + jacocoTestReport { reports { xml.required = true @@ -298,7 +302,6 @@ jacocoTestReport { } } -javadoc { - // prevent java 8's strict doclint for javadocs from failing builds - options.addStringOption('Xdoclint:accessibility,html,reference,syntax', '-quiet') +jacoco { + toolVersion = "0.8.12" } diff --git a/buildSrc/src/main/groovy/multiloader-loader-fabric.gradle b/buildSrc/src/main/groovy/multiloader-loader-fabric.gradle index 5e2372e33b..d7df24ac37 100644 --- a/buildSrc/src/main/groovy/multiloader-loader-fabric.gradle +++ b/buildSrc/src/main/groovy/multiloader-loader-fabric.gradle @@ -52,6 +52,16 @@ task runGameTestServer { dependsOn tasks.runGameTest } +// Measure coverage for game tests +jacoco { + applyTo runGameTest +} +jacocoTestReport { + dependsOn test, runGameTest + // Include unit and game test coverage + executionData fileTree(project.buildDir).include("jacoco/*.exec") +} + publishing { publications { PublicationContainer publicationContainer -> publicationContainer.getByName("maven") { MavenPublication publication -> diff --git a/buildSrc/src/main/groovy/multiloader-loader-neoforge.gradle b/buildSrc/src/main/groovy/multiloader-loader-neoforge.gradle index e0eb0c81c6..af521fdb71 100644 --- a/buildSrc/src/main/groovy/multiloader-loader-neoforge.gradle +++ b/buildSrc/src/main/groovy/multiloader-loader-neoforge.gradle @@ -76,17 +76,30 @@ runs { } } -tasks.register('signJar').configure { - dependsOn(tasks.jar) - - onlyIf { - System.getenv().SIGN_KEYSTORE +// Disabled because signed jars are not being checked anyways +//tasks.register('signJar').configure { +// dependsOn(tasks.jar) +// +// onlyIf { +// System.getenv().SIGN_KEYSTORE +// } +// +// keyStore = System.getenv().SIGN_KEYSTORE +// alias = System.getenv().SIGN_ALIAS +// storePass = System.getenv().SIGN_STOREPASS +// keyPass = System.getenv().SIGN_KEYPASS +// input = jar.archivePath +// output = jar.archivePath +//} + +// Measure coverage for game tests +tasks.whenTaskAdded { task -> + if (task.name.equals('runGameTestServer')) { + jacocoTestReport.dependsOn test, task + jacoco.applyTo(task) } - - keyStore = System.getenv().SIGN_KEYSTORE - alias = System.getenv().SIGN_ALIAS - storePass = System.getenv().SIGN_STOREPASS - keyPass = System.getenv().SIGN_KEYPASS - input = jar.archivePath - output = jar.archivePath +} +jacocoTestReport { + // Include unit and game test coverage + executionData fileTree(project.buildDir).include("jacoco/*.exec") }