internal/ci: further tidy up
* Have our caches work in read-write mode when running on the test
default branch (generally ci/test). This allows us to more easily test
whether a cache-related change will work, with repeated pushes/runs to
the change on the ci/test branch.
* Make dummy dispatch data optional for the trybot_dispatch workflow
when pushed to ci/test. We correspondingly extend the GitHub
expression that determines when to run the dispatch workflow to
include a check to see whether the dummy data is valid or not.
* Declare isTestDefaultBranch as a reusable means of checking in an 'if'
condition whether we are running on the test default branch.
* Declare a field that captures the GitHub expression that can be used
to dereference the decoded Dispatch-Trailer value.
* Do not run evict_caches on pushes to the default test branch. Evict
caches deletes all existing caches on the main and trybot repos and
as such should only be run with care, when testing changes to this
workflow, and when nobody else is relying on the caches! Otherwise
it's too easy to forget that pushing to ci/test (which should be safe)
can cause the trybot runs to blow up in terms of runtimes.
* Extend the existing setupGoActionsCaches template with a parameter
#additionalCacheDirs that allows additional paths to be to the caching
step. At this point, the template "setupGoActionsCaches" is poorly
named because there isn't anything unique to Go happening here. Just
that we need to do more lifting when it comes to Go caches than
anything else.
* Remove internal/ci/github/gen_trybot_dispatch.cue to remove the fake
dispatch data.
Signed-off-by: Paul Jolly <paul@myitcv.io>
Change-Id: Ifd454d072b61c4ffb080a870fdf7638e10bd4590
Reviewed-on: https://review.gerrithub.io/c/cue-lang/cue/+/552365
Unity-Result: CUE porcuepine <cue.porcuepine@gmail.com>
TryBot-Result: CUEcueckoo <cueckoo+gerrithub@cuelang.org>
Reviewed-by: Daniel Martí <mvdan@mvdan.cc>