diff --git a/.github/workflows/branches-and-prs.main.kts b/.github/workflows/branches-and-prs.main.kts index b0262eba4a..0d514fa6cc 100755 --- a/.github/workflows/branches-and-prs.main.kts +++ b/.github/workflows/branches-and-prs.main.kts @@ -67,12 +67,18 @@ workflow( ) } + val matrix = Matrix.full + with(__FILE__.parentFile.resolve("../../codecov.yml")) { + readText() + .replace("after_n_builds:.*+$".toRegex(), "after_n_builds: ${matrix.size}") + .let(::writeText) + } job( id = "build-and-verify", name = "Build and Verify", runsOn = RunnerType.Custom(expr(Matrix.operatingSystem)), strategy = Strategy( - matrix = Matrix.full + matrix = matrix ) ) { uses( diff --git a/.github/workflows/common.main.kts b/.github/workflows/common.main.kts index eefc0020ea..495b4bb0ef 100755 --- a/.github/workflows/common.main.kts +++ b/.github/workflows/common.main.kts @@ -58,6 +58,8 @@ data class Matrix( val excludes: List>? = null, val includes: List>? = null ) { + val size = ((variants?.size ?: 1) * (javaVersions?.size ?: 1)) - (excludes?.size ?: 0) + (includes?.size ?: 0) + fun toCustomArguments() = mapOf( *listOfNotNull( operatingSystems?.let { "os" to operatingSystems }, diff --git a/.github/workflows/release.main.kts b/.github/workflows/release.main.kts index c5a79cc519..609070b02b 100755 --- a/.github/workflows/release.main.kts +++ b/.github/workflows/release.main.kts @@ -46,13 +46,19 @@ workflow( val SONATYPE_OSS_PASSWORD by secrets val SIGNING_GPG_PASSWORD by secrets + val matrix = Matrix.full + with(__FILE__.parentFile.resolve("../../codecov.yml")) { + readText() + .replace("after_n_builds:.*+$".toRegex(), "after_n_builds: ${matrix.size}") + .let(::writeText) + } val buildAndVerify = job( id = "build-and-verify", name = "Build and Verify", runsOn = RunnerType.Custom(expr(Matrix.operatingSystem)), condition = "${github.repository} == 'spockframework/spock'", strategy = Strategy( - matrix = Matrix.full + matrix = matrix ) ) { uses(