diff --git a/orbs/shared/commands/setup_environment.yml b/orbs/shared/commands/setup_environment.yml index 0ba10bca..ca3efa46 100755 --- a/orbs/shared/commands/setup_environment.yml +++ b/orbs/shared/commands/setup_environment.yml @@ -22,6 +22,12 @@ parameters: description: Skips restoring the cache in case a clean slate is needed. type: boolean default: true + restore_e2e_cache: + description: >- + Restore the e2e daily cache containing asdf/mise tool installs. + Use for machine executor jobs that need tool binaries. + type: boolean + default: false checkout_method: description: checkout method per https://circleci.com/docs/reference/configuration-reference/#checkout type: enum @@ -37,7 +43,13 @@ steps: steps: - restore_cache: keys: - - v2-daily-cache-{{ arch }}- + - v1-daily-cache-{{ arch }}- + - when: + condition: << parameters.restore_e2e_cache >> + steps: + - restore_cache: + keys: + - v1-e2e-daily-cache-{{ arch }}- # Adds a github org scoped SSH key to the project added by Wheatley - add_ssh_keys - when: diff --git a/orbs/shared/jobs/e2e.yaml b/orbs/shared/jobs/e2e.yaml index e70c9135..2d905dbc 100644 --- a/orbs/shared/jobs/e2e.yaml +++ b/orbs/shared/jobs/e2e.yaml @@ -55,6 +55,7 @@ resource_class: << parameters.resource_class >> steps: - setup_environment: machine: true + restore_e2e_cache: true - run: name: Run E2E Tests command: KUBECONFIG="$HOME/.outreach/kubeconfig.yaml" make e2e diff --git a/orbs/shared/jobs/save_cache.yaml b/orbs/shared/jobs/save_cache.yaml index ba8ba726..d8d3a28b 100644 --- a/orbs/shared/jobs/save_cache.yaml +++ b/orbs/shared/jobs/save_cache.yaml @@ -60,7 +60,7 @@ steps: steps: - restore_cache: keys: - - v2-toggle-daily-cache-{{ arch }}-{{ .Revision }} + - v1-toggle-daily-cache-{{ arch }}-{{ .Revision }} - run: name: Check cache flag command: | @@ -77,15 +77,20 @@ steps: - run: name: Run tests command: make test + # Daily cache restored by all jobs (Docker and machine executors) - save_cache: - key: v2-daily-cache-{{ arch }}-{{ epoch }} + key: v1-daily-cache-{{ arch }}-{{ epoch }} paths: - "~/.cache" - - "~/.asdf" - "~/.outreach/.cache" + # E2E cache with asdf/mise tool installs for machine-executor jobs + - save_cache: + key: v1-e2e-daily-cache-{{ arch }}-{{ epoch }} + paths: + - "~/.asdf" - "~/.local/share/mise" - save_cache: - key: v2-toggle-daily-cache-{{ arch }}-{{ .Revision }} + key: v1-toggle-daily-cache-{{ arch }}-{{ .Revision }} paths: - "~/cache-toggle"