File tree Expand file tree Collapse file tree 3 files changed +37
-4
lines changed
Expand file tree Collapse file tree 3 files changed +37
-4
lines changed Original file line number Diff line number Diff 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" ,
Original file line number Diff line number Diff 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" ,
Original file line number Diff line number Diff 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+
408425tasks. 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
412431tasks. 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}
You can’t perform that action at this time.
0 commit comments