ci: Re-run tests that fail due to GitHub runner flakiness (#1096)

This commit is contained in:
Nik Clayton 2024-11-13 22:38:46 +01:00 committed by GitHub
parent 0fea570ea0
commit c50fab1f5d
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 43 additions and 27 deletions

View File

@ -1,27 +0,0 @@
plugins {
alias(libs.plugins.android.application) apply false
alias(libs.plugins.android.library) apply false
alias(libs.plugins.android.lint) apply false
alias(libs.plugins.google.ksp) apply false
alias(libs.plugins.kotlin.android) apply false
alias(libs.plugins.kotlin.jvm) apply false
alias(libs.plugins.kotlin.parcelize) apply false
alias(libs.plugins.ktlint) apply false
alias(libs.plugins.aboutlibraries) apply false
alias(libs.plugins.hilt) apply false
alias(libs.plugins.quadrant) apply false
}
allprojects {
apply plugin: libs.plugins.ktlint.get().pluginId
plugins.withType(JavaBasePlugin).configureEach {
java {
toolchain.languageVersion = JavaLanguageVersion.of(17)
}
}
}
tasks.register('clean') {
delete layout.buildDirectory
}

43
build.gradle.kts Normal file
View File

@ -0,0 +1,43 @@
plugins {
alias(libs.plugins.android.application) apply false
alias(libs.plugins.android.library) apply false
alias(libs.plugins.android.lint) apply false
alias(libs.plugins.google.ksp) apply false
alias(libs.plugins.kotlin.android) apply false
alias(libs.plugins.kotlin.jvm) apply false
alias(libs.plugins.kotlin.parcelize) apply false
alias(libs.plugins.ktlint) apply false
alias(libs.plugins.aboutlibraries) apply false
alias(libs.plugins.hilt) apply false
alias(libs.plugins.quadrant) apply false
}
allprojects {
apply(
plugin =
rootProject.libs.plugins.ktlint
.get()
.pluginId,
)
}
// GitHub action runners can timeout resulting in occasional test flakiness.
// Re-run tests on CI to work around this, while disallowing failing tests
// when developing locally.
subprojects {
val isCiBuild = providers.environmentVariable("CI").isPresent
if (isCiBuild) {
tasks.withType<Test>().configureEach {
develocity.testRetry {
maxRetries = 4
maxFailures = 5
failOnPassedAfterRetry = false
}
}
}
}
tasks.register<Delete>("clean") {
delete(layout.buildDirectory)
}