Ryan Cragun f7ab5ca73d
go: don't download pipeline modules when caching build modules (#29224)
Various different CI jobs need Go modules in order to build or test
Vault. To speed this up in CI we cache them in Github Actions.
The caching requires downloading all modules first in order to upload
them to the actions cache, which is performed by calling the
`go-mod-download` Make target. This target will iterate over the
directory tree and download Go modules in all directories that include
a `go.mod` file.

There are two small problems with this approach that we resolved with
this PR:
* Our `go-mod-download` target would download modules for all
  `go.mod`'s present in the directory tree, regardless of whether or not
  they are required to build or test Vault. Only downloading those
  required results in slightly smaller caches.
* `tools/pipeline` is intentionally a separate Go module so as to not
  require its modules in order to build Vault, however, our
  `go-mod-download` downloading all modules requires the workflow
  environment to include auth credentials for internal modules. If a
  community contributed PRs modifies a `go.mod`, which in turn requires
  a new cache, the PR will always fail because it cannot download
  modules that require secrets.

Now we avoid installing our `tools/pipeline` modules when generating our
module cache which should allow community contributed PRs to execute
build and Go tests, while skipping enos workflows which already required
secrets and were thus skipped.

Signed-off-by: Ryan Cragun <me@ryan.ec>
2024-12-19 09:17:51 -07:00
..
2024-05-16 16:02:01 +00:00
2024-05-16 16:02:01 +00:00
2022-12-07 13:29:51 -05:00
2023-08-10 18:14:03 -07:00
2023-08-10 18:14:03 -07:00