Skip to content

Commit fc7376a

Browse files
committed
Review Feedback Vol. 1
1 parent f495715 commit fc7376a

File tree

3 files changed

+37
-4
lines changed

3 files changed

+37
-4
lines changed

.github/workflows/branches-and-prs.main.kts

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,13 @@ workflow(
8484
with(__FILE__.parentFile.resolve("../codecov.yml")) {
8585
readText()
8686
.replace("after_n_builds:.*+$".toRegex(), "after_n_builds: ${matrix.size}")
87-
.let(::writeText)
87+
.let {
88+
parentFile
89+
.resolve("../build/")
90+
.apply { mkdirs() }
91+
.resolve("codecov_branches-and-prs.yml")
92+
.writeText(it)
93+
}
8894
}
8995
job(
9096
id = "build-and-verify",

.github/workflows/release.main.kts

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,13 @@ workflow(
5555
with(__FILE__.parentFile.resolve("../codecov.yml")) {
5656
readText()
5757
.replace("after_n_builds:.*+$".toRegex(), "after_n_builds: ${matrix.size}")
58-
.let(::writeText)
58+
.let {
59+
parentFile
60+
.resolve("../build/")
61+
.apply { mkdirs() }
62+
.resolve("codecov_release.yml")
63+
.writeText(it)
64+
}
5965
}
6066
val buildAndVerify = job(
6167
id = "build-and-verify",

build.gradle

Lines changed: 23 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -405,10 +405,31 @@ def configureGroovydoc(TaskProvider groovydoc) {
405405
}
406406
}
407407

408+
def preprocessBranchesAndPrsWorkflowCodecovOutput = layout.buildDirectory.file('codecov_branches-and-prs.yml')
409+
def preprocessReleaseWorkflowCodecovOutput = layout.buildDirectory.file('codecov_release.yml')
410+
411+
def copyCodecovConfig = tasks.register('copyCodecovConfig') {
412+
doLast {
413+
copy {
414+
from(
415+
[
416+
preprocessBranchesAndPrsWorkflowCodecovOutput,
417+
preprocessReleaseWorkflowCodecovOutput
418+
].max {it.get().asFile.lastModified() })
419+
into('.github')
420+
rename { 'codecov.yml' }
421+
}
422+
}
423+
}
424+
408425
tasks.preprocessBranchesAndPrsWorkflow {
409-
outputs.file('.github/codecov.yml').withPropertyName('codecovConfig')
426+
inputs.file('.github/codecov.yml').withPropertyName('codecovConfig')
427+
outputs.file(preprocessBranchesAndPrsWorkflowCodecovOutput).withPropertyName('codecovConfig')
428+
finalizedBy(copyCodecovConfig)
410429
}
411430

412431
tasks.preprocessReleaseWorkflow {
413-
outputs.file('.github/codecov.yml').withPropertyName('codecovConfig')
432+
inputs.file('.github/codecov.yml').withPropertyName('codecovConfig')
433+
outputs.file(preprocessReleaseWorkflowCodecovOutput).withPropertyName('codecovConfig')
434+
finalizedBy(copyCodecovConfig)
414435
}

0 commit comments

Comments
 (0)