Test and verify coverage only on debug variant (#2556)
* Test and verify coverage only on debug variant * Set files to upload * Fix also nightlyReports flow
This commit is contained in:
parent
1df8f53673
commit
b488cbbfb8
4 changed files with 8 additions and 32 deletions
2
.github/workflows/nightlyReports.yml
vendored
2
.github/workflows/nightlyReports.yml
vendored
|
|
@ -33,7 +33,7 @@ jobs:
|
||||||
run: ./gradlew verifyPaparazziDebug $CI_GRADLE_ARG_PROPERTIES
|
run: ./gradlew verifyPaparazziDebug $CI_GRADLE_ARG_PROPERTIES
|
||||||
|
|
||||||
- name: 📈 Generate kover report and verify coverage
|
- name: 📈 Generate kover report and verify coverage
|
||||||
run: ./gradlew :app:koverHtmlReport :app:koverXmlReport :app:koverVerify $CI_GRADLE_ARG_PROPERTIES -Pci-build=true
|
run: ./gradlew :app:koverXmlReportGplayDebug :app:koverHtmlReportGplayDebug :app:koverVerifyGplayDebug $CI_GRADLE_ARG_PROPERTIES
|
||||||
|
|
||||||
- name: ✅ Upload kover report
|
- name: ✅ Upload kover report
|
||||||
if: always()
|
if: always()
|
||||||
|
|
|
||||||
12
.github/workflows/tests.yml
vendored
12
.github/workflows/tests.yml
vendored
|
|
@ -48,14 +48,14 @@ jobs:
|
||||||
with:
|
with:
|
||||||
cache-read-only: ${{ github.ref != 'refs/heads/develop' }}
|
cache-read-only: ${{ github.ref != 'refs/heads/develop' }}
|
||||||
|
|
||||||
- name: ⚙️ Run unit tests, debug and release
|
- name: ⚙️ Run unit tests for debug variant
|
||||||
run: ./gradlew test $CI_GRADLE_ARG_PROPERTIES
|
run: ./gradlew testDebugUnitTest $CI_GRADLE_ARG_PROPERTIES
|
||||||
|
|
||||||
- name: 📸 Run screenshot tests
|
- name: 📸 Run screenshot tests
|
||||||
run: ./gradlew verifyPaparazziDebug $CI_GRADLE_ARG_PROPERTIES
|
run: ./gradlew verifyPaparazziDebug $CI_GRADLE_ARG_PROPERTIES
|
||||||
|
|
||||||
- name: 📈Generate kover report and verify coverage
|
- name: 📈Generate kover report and verify coverage
|
||||||
run: ./gradlew :app:koverHtmlReport :app:koverXmlReport :app:koverVerify $CI_GRADLE_ARG_PROPERTIES -Pci-build=true
|
run: ./gradlew :app:koverXmlReportGplayDebug :app:koverHtmlReportGplayDebug :app:koverVerifyGplayDebug $CI_GRADLE_ARG_PROPERTIES
|
||||||
|
|
||||||
- name: 🚫 Upload kover failed coverage reports
|
- name: 🚫 Upload kover failed coverage reports
|
||||||
if: failure()
|
if: failure()
|
||||||
|
|
@ -63,7 +63,7 @@ jobs:
|
||||||
with:
|
with:
|
||||||
name: kover-error-report
|
name: kover-error-report
|
||||||
path: |
|
path: |
|
||||||
app/build/reports/kover/verify.err
|
app/build/reports/kover/verifyGplayDebug.err
|
||||||
|
|
||||||
- name: ✅ Upload kover report (disabled)
|
- name: ✅ Upload kover report (disabled)
|
||||||
if: always()
|
if: always()
|
||||||
|
|
@ -85,5 +85,5 @@ jobs:
|
||||||
with:
|
with:
|
||||||
fail_ci_if_error: true
|
fail_ci_if_error: true
|
||||||
token: ${{ secrets.CODECOV_TOKEN }}
|
token: ${{ secrets.CODECOV_TOKEN }}
|
||||||
# with:
|
files: app/build/reports/kover/reportGplayDebug.xml
|
||||||
# files: build/reports/kover/xml/report.xml
|
verbose: true
|
||||||
|
|
|
||||||
|
|
@ -24,7 +24,6 @@ import extension.gitBranchName
|
||||||
import extension.gitRevision
|
import extension.gitRevision
|
||||||
import extension.koverDependencies
|
import extension.koverDependencies
|
||||||
import extension.setupKover
|
import extension.setupKover
|
||||||
import org.jetbrains.kotlin.cli.common.toBooleanLenient
|
|
||||||
|
|
||||||
plugins {
|
plugins {
|
||||||
id("io.element.android-compose-application")
|
id("io.element.android-compose-application")
|
||||||
|
|
@ -189,7 +188,7 @@ androidComponents {
|
||||||
val abiCode = abiVersionCodes[name] ?: 0
|
val abiCode = abiVersionCodes[name] ?: 0
|
||||||
// Assigns the new version code to output.versionCode, which changes the version code
|
// Assigns the new version code to output.versionCode, which changes the version code
|
||||||
// for only the output APK, not for the variant itself.
|
// for only the output APK, not for the variant itself.
|
||||||
output.versionCode.set((output.versionCode.get() ?: 0) * 10 + abiCode)
|
output.versionCode.set((output.versionCode.orNull ?: 0) * 10 + abiCode)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -215,26 +214,6 @@ knit {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
val ciBuildProperty = "ci-build"
|
|
||||||
val isCiBuild = if (project.hasProperty(ciBuildProperty)) {
|
|
||||||
val raw = project.property(ciBuildProperty) as? String
|
|
||||||
raw?.toBooleanLenient() == true || raw?.toIntOrNull() == 1
|
|
||||||
} else {
|
|
||||||
false
|
|
||||||
}
|
|
||||||
|
|
||||||
kover {
|
|
||||||
// When running on the CI, run only debug test variants
|
|
||||||
if (isCiBuild) {
|
|
||||||
excludeTests {
|
|
||||||
// Disable instrumentation for debug test tasks
|
|
||||||
tasks(
|
|
||||||
"testDebugUnitTest",
|
|
||||||
)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
dependencies {
|
dependencies {
|
||||||
allLibrariesImpl()
|
allLibrariesImpl()
|
||||||
allServicesImpl()
|
allServicesImpl()
|
||||||
|
|
|
||||||
|
|
@ -100,7 +100,6 @@ fun Project.setupKover() {
|
||||||
defaults {
|
defaults {
|
||||||
// add reports of both 'debug' and 'release' Android build variants to default reports
|
// add reports of both 'debug' and 'release' Android build variants to default reports
|
||||||
mergeWith("gplayDebug")
|
mergeWith("gplayDebug")
|
||||||
mergeWith("gplayRelease")
|
|
||||||
|
|
||||||
verify {
|
verify {
|
||||||
onCheck = true
|
onCheck = true
|
||||||
|
|
@ -203,8 +202,6 @@ fun Project.setupKover() {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
androidReports("gplayRelease") {}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue