File tree Expand file tree Collapse file tree 3 files changed +36
-3
lines changed
Expand file tree Collapse file tree 3 files changed +36
-3
lines changed Original file line number Diff line number Diff line change 2121 java-version : 17
2222
2323 - name : Build and Test coverage Report
24- run : bash ./gradlew test jacocoTestReport --stacktrace
24+ run : bash ./gradlew test unitTestCoverageReport --stacktrace
2525
2626 - uses : codecov/codecov-action@v5.1.2
27+ with :
28+ files : ./app/build/reports/jacoco/unitTestCoverageReport/unitTestCoverageReport.xml,./securesmsproxyapi/build/reports/jacoco/unitTestCoverageReport/unitTestCoverageReport.xml
29+ token : ${{ secrets.CODECOV_TOKEN }}
2730
2831 apk :
2932 name : Generate APK
Original file line number Diff line number Diff line change @@ -13,7 +13,19 @@ int vcode = Integer.parseInt((versionProps['VERSION_CODE'] == null || versionPro
1313String vname = (versionProps[' VERSION_NAME' ] == null || versionProps[' VERSION_NAME' ]. startsWith(' $' )) ? ' 3.5.0-dev' : versionProps[' VERSION_NAME' ]
1414
1515jacoco {
16- toolVersion = " 0.8.7"
16+ toolVersion = " 0.8.12"
17+ }
18+
19+ tasks. register(" unitTestCoverageReport" , JacocoReport ) {
20+ group = " Coverage"
21+ dependsOn tasks. testDebugUnitTest
22+ reports {
23+ html. required = true
24+ xml. required = true
25+ }
26+ executionData. from = layout. buildDirectory. dir(" outputs/unit_test_code_coverage/debugUnitTest/testDebugUnitTest.exec" )
27+ classDirectories. from = layout. buildDirectory. dir(" intermediates/javac/debug/compileDebugJavaWithJavac/classes" )
28+ sourceDirectories. from = layout. projectDirectory. dir(" src/main/java" )
1729}
1830
1931android {
@@ -27,6 +39,9 @@ android {
2739 testInstrumentationRunner " androidx.test.runner.AndroidJUnitRunner"
2840 }
2941 buildTypes {
42+ debug {
43+ enableUnitTestCoverage true
44+ }
3045 release {
3146 minifyEnabled false
3247 proguardFiles getDefaultProguardFile(' proguard-android-optimize.txt' ), ' proguard-rules.pro'
Original file line number Diff line number Diff line change @@ -26,7 +26,19 @@ ext["ossUsername"] = System.getenv('OSS_USERNAME')
2626ext[" ossPassword" ] = System . getenv(' OSS_PASSWORD' )
2727
2828jacoco {
29- toolVersion = " 0.8.7"
29+ toolVersion = " 0.8.12"
30+ }
31+
32+ tasks. register(" unitTestCoverageReport" , JacocoReport ) {
33+ group = " Coverage"
34+ dependsOn tasks. testDebugUnitTest
35+ reports {
36+ html. required = true
37+ xml. required = true
38+ }
39+ executionData. from = layout. buildDirectory. dir(" outputs/unit_test_code_coverage/debugUnitTest/testDebugUnitTest.exec" )
40+ classDirectories. from = layout. buildDirectory. dir(" intermediates/javac/debug/compileDebugJavaWithJavac/classes" )
41+ sourceDirectories. from = layout. projectDirectory. dir(" src/main/java" )
3042}
3143
3244android {
@@ -43,6 +55,9 @@ android {
4355 }
4456
4557 buildTypes {
58+ debug {
59+ enableUnitTestCoverage true
60+ }
4661 release {
4762 minifyEnabled false
4863 proguardFiles getDefaultProguardFile(' proguard-android-optimize.txt' ), ' proguard-rules.pro'
You can’t perform that action at this time.
0 commit comments