forked from ForgeRock/forgerock-android-sdk
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #12 from spetrov/jacoco
Jacoco test coverage reports
- Loading branch information
Showing
6 changed files
with
43 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -33,19 +33,19 @@ jobs: | |
|
||
# Execute forgerock-core debug unit tests | ||
- name: Run forgerock-core debug unit tests | ||
run: ./gradlew :forgerock-core:testDebugUnitTest --stacktrace --no-daemon | ||
run: ./gradlew :forgerock-core:jacocoReport --stacktrace --no-daemon | ||
|
||
# Execute forgerock-auth debug unit tests | ||
- name: Run forgerock-auth debug unit tests | ||
run: ./gradlew :forgerock-auth:testDebugUnitTest --stacktrace --no-daemon | ||
run: ./gradlew :forgerock-auth:jacocoReport --stacktrace --no-daemon | ||
|
||
# Execute forgerock-authenticator debug unit tests | ||
- name: Run forgerock-authenticator debug unit tests | ||
run: ./gradlew :forgerock-authenticator:testDebugUnitTest --stacktrace --no-daemon | ||
run: ./gradlew :forgerock-authenticator:jacocoReport --stacktrace --no-daemon | ||
|
||
# Execute forgerock-authenticator debug unit tests | ||
- name: Run ping-protect debug unit tests | ||
run: ./gradlew :ping-protect:testDebugUnitTest --stacktrace --no-daemon | ||
run: ./gradlew :ping-protect:jacocoReport --stacktrace --no-daemon | ||
|
||
# Publish test reports for the unit tests | ||
- name: Publish test results | ||
|
@@ -59,6 +59,11 @@ jobs: | |
fail-on-error: 'true' | ||
reporter: java-junit | ||
|
||
- name: Upload coverage reports to Codecov | ||
uses: codecov/[email protected] | ||
with: | ||
token: ${{ secrets.CODECOV_TOKEN }} | ||
|
||
# Send slack notification with result status | ||
- uses: 8398a7/action-slack@v3 | ||
with: | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
apply plugin: 'jacoco' | ||
|
||
jacoco { | ||
toolVersion = "0.8.12" | ||
} | ||
|
||
task jacocoReport(type: JacocoReport, dependsOn: 'testDebugUnitTest') { | ||
reports { | ||
csv { enabled false } // change if needed | ||
xml { enabled true } // change if needed | ||
html { | ||
enabled true | ||
destination file("${buildDir}/coverage-report") | ||
} | ||
} | ||
|
||
// Setup the .class, source, and execution directories | ||
final fileFilter = ['**/R.class', '**/R$*.class', '**/BuildConfig.*', '**/Manifest*.*', 'android/**/*.*'] | ||
|
||
// Include this if you use Kotlin | ||
final kotlinTree = fileTree(dir: "${project.buildDir}/tmp/kotlin-classes/debug", excludes: fileFilter) | ||
final javacTree = fileTree(dir: "${project.buildDir}/intermediates/javac/debug", excludes: fileFilter) | ||
final mainSrc = "${project.projectDir}/src/main/java" | ||
|
||
sourceDirectories.setFrom files([mainSrc]) | ||
classDirectories.setFrom files([kotlinTree, javacTree]) | ||
executionData.setFrom fileTree(dir: project.buildDir, includes: [ | ||
'jacoco/testDebugUnitTest.exec', 'outputs/code-coverage/connected/*coverage.ec' | ||
]) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters