vault/scripts
Ryan Cragun 0d8f1d30f3
VAULT-36174: pipeline(go): deal with relative path issues in cache restore (#30650)
* VAULT-36174: pipeline(go): Deal with relative path issues in cache restore

Cache restore have some surprising relative pathing behavior we need
to deal with. Since our Go module cache-path is in $HOME
(/home/runner/go/...) and $HOME can be different depending on our
self-hosted vs Github hosted runners (/home/runner/actions-runner/_work
vs. /home/runner/work) we need to factor in the absolute path of $HOME
when creating our cache key. If we don't then cache restores will be
incompatible on one or the other runner. This is because the tar restore
uses relative paths backwards our our depth doesn't match on both
runners.

We also slightly change our module caches here to only get
`.../mod/cache` instead of the whole `.../mod` directory. Go is able
to unzip the modules in cache faster than it takes a longer download
with the entire mod directory.

This will double our module caches *sigh* but they ought to be smaller
as they only contain the module zips.

See: https://github.com/actions/cache/issues/1127

Signed-off-by: Ryan Cragun <me@ryan.ec>

* use working dir, not home

Signed-off-by: Ryan Cragun <me@ryan.ec>

* fix logic on no-save

Signed-off-by: Ryan Cragun <me@ryan.ec>

* do a module list after download

Signed-off-by: Ryan Cragun <me@ryan.ec>

---------

Signed-off-by: Ryan Cragun <me@ryan.ec>
2025-05-16 12:41:18 -06:00
..
cross Update node to version 20 (#27080) 2024-05-16 16:02:01 +00:00
docker Update node to version 20 (#27080) 2024-05-16 16:02:01 +00:00
windows Move version out of SDK. (#14229) 2022-12-07 13:29:51 -05:00
assetcheck.sh [COMPLIANCE] License changes (#22290) 2023-08-10 18:14:03 -07:00
build.sh [COMPLIANCE] License changes (#22290) 2023-08-10 18:14:03 -07:00
ci-helper.sh VAULT-34477: Add s390x multilib compiler to build-vault action (#29837) 2025-03-05 13:10:55 -07:00
copywrite-exceptions.sh exclude *_ent_test.go from copywrite-exceptions.sh (#29319) 2025-01-08 21:21:19 +00:00
coverage.sh [COMPLIANCE] License changes (#22290) 2023-08-10 18:14:03 -07:00
deprecations-checker.sh [QT-645] Restructure dev tools (#24559) 2024-01-09 17:50:46 +00:00
dist.sh [COMPLIANCE] License changes (#22290) 2023-08-10 18:14:03 -07:00
gen_openapi.sh Add tweaks to tests for the new enterprise SCEP test (#30495) 2025-05-02 11:28:16 -04:00
go-helper.sh VAULT-36174: pipeline(go): deal with relative path issues in cache restore (#30650) 2025-05-16 12:41:18 -06:00
semgrep_plugin_repos.sh [COMPLIANCE] License changes (#22290) 2023-08-10 18:14:03 -07:00
testciphers.sh [COMPLIANCE] License changes (#22290) 2023-08-10 18:14:03 -07:00
update_plugin_modules.sh [COMPLIANCE] License changes (#22290) 2023-08-10 18:14:03 -07:00