-
Notifications
You must be signed in to change notification settings - Fork 21
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
45 additions
and
0 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 |
---|---|---|
|
@@ -58,6 +58,9 @@ jobs: | |
echo "Free space:" | ||
df -h | ||
- name: Run Coverage | ||
run: ./gradlew :xendit-android:jacocoReport | ||
|
||
- name: Grant execute permission for gradlew | ||
run: chmod +x gradlew | ||
|
||
|
@@ -72,6 +75,16 @@ jobs: | |
emulator-options: -no-snapshot-save -no-window -gpu swiftshader_indirect -noaudio -no-boot-anim -camera-back none | ||
script: ./gradlew :xendit-android:connectedCheck --stacktrace | ||
|
||
- name: Add coverage to PR | ||
id: jacoco | ||
uses: madrapps/[email protected] | ||
with: | ||
paths: | | ||
${{ github.workspace }}/**/build/reports/coverage/androidTest/debug/connected/report.xml | ||
token: ${{ secrets.GITHUB_TOKEN }} | ||
min-coverage-overall: 40 | ||
min-coverage-changed-files: 60 | ||
|
||
# notify-slack: | ||
# needs: unit-test | ||
# runs-on: ubuntu-latest | ||
|
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
apply plugin: 'jacoco' | ||
|
||
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