Make the preprocessing tasks for workflow files cacheable
- #2157
👈 (View in Graphite) master
This stack of pull requests is managed by Graphite. Learn more about stacking.
Codecov Report
:white_check_mark: All modified and coverable lines are covered by tests.
:white_check_mark: Project coverage is 81.90%. Comparing base (5d220ca) to head (cf896a5).
:warning: Report is 1 commits behind head on master.
Additional details and impacted files
@@ Coverage Diff @@
## master #2157 +/- ##
============================================
- Coverage 81.91% 81.90% -0.01%
- Complexity 4732 4735 +3
============================================
Files 463 463
Lines 14767 14767
Branches 1869 1869
============================================
- Hits 12096 12095 -1
- Misses 1980 1981 +1
Partials 691 691
:rocket: New features to boost your workflow:
- :snowflake: Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
You still have overlapping outputs for all workflow tasks:
- https://ge.spockframework.org/s/n5ofs5ftv6czg/timeline?details=3yt6nuz2vwgza
- https://ge.spockframework.org/s/n5ofs5ftv6czg/timeline?details=6lhcybvrqmfrk
- https://ge.spockframework.org/s/n5ofs5ftv6czg/timeline?details=6ykqsd4xqsblq
- https://ge.spockframework.org/s/n5ofs5ftv6czg/timeline?details=uvtxjtpy2mnnc
But the question remains where you copied the warning with docs-pr.yaml from.
From the preprocessDocsPrWorkflow, as all had the same issue, I just picked one task at random.
Huh, somehow this does not make any sense.
I made a non-sense change before pushing, so that if the file is coming from cache, the codecov file is not updated, I'll make a new push with that fixed like I had it before that last change.
Besides that the cache key is also bad as I forgot to define path sensitivity.
But either way, there are no overlapping outputs anymore. Especially the file it complains about is dedicated to that one task and there should not be any overlap. Locally the result is taken from cache just fine: https://ge.spockframework.org/s/4phvtkur47e74/timeline?details=3yt6nuz2vwgza&expanded=WyIxIl0
I even added
allprojects { tasks.all {} }
tasks.register('foo') {
doLast {
allprojects*.tasks*.all { task ->
outputs.files.files.findAll { it.absolutePath.contains('.github') }.each {
println("FOO: ${task.name} | ${it.absolutePath}")
}
}
}
}
and all I got was the expected
FOO: preprocessBranchesAndPrsWorkflow | D:\Sourcecode\other\spock\.github\workflows\branches-and-prs.yaml
FOO: preprocessCodeqlAnalysisWorkflow | D:\Sourcecode\other\spock\.github\workflows\codeql-analysis.yaml
FOO: preprocessCommonWorkflow | D:\Sourcecode\other\spock\.github\workflows\common.yaml
FOO: preprocessDocsPrWorkflow | D:\Sourcecode\other\spock\.github\workflows\docs-pr.yaml
FOO: preprocessReleaseWorkflow | D:\Sourcecode\other\spock\.github\workflows\release.yaml
:-/
Same on GHA: https://ge.spockframework.org/s/vnf6tebn2ygd4/console-log?page=1#L100 while the complaint stays the same: https://ge.spockframework.org/s/vnf6tebn2ygd4/timeline?details=3yt6nuz2vwgza
Also using the ghActionsBuild task locally works just fine here: https://ge.spockframework.org/s/y6x7rzl55yags/timeline?details=3yt6nuz2vwgza, now even the cache key is the same as on GHA.
Argh, it is because it is a clean checkout where the file already exists and Gradle does not know that itself was the one creating it. 🙈
Ok, with that knowledge now finally the tasks are also cacheable on GHA