From 5382e6d1506162a7def066b2bf73ae8f1dcd51e2 Mon Sep 17 00:00:00 2001 From: Zach Bloomquist Date: Fri, 18 Feb 2022 19:07:40 -0500 Subject: [PATCH] try using platform_key --- circle.yml | 40 ++++++++++++++++++++++++++-------------- 1 file changed, 26 insertions(+), 14 deletions(-) diff --git a/circle.yml b/circle.yml index 5c126df11c98..2edd9135a6af 100644 --- a/circle.yml +++ b/circle.yml @@ -167,9 +167,12 @@ commands: - run: name: Generate Circle Cache Key command: node scripts/circle-cache.js --action cacheKey > circle_cache_key + - run: + name: Generate platform key + command: echo $PLATFORM > platform_key - restore_cache: name: Restore cache state, to check for known modules cache existence - key: v{{ .Environment.CACHE_VERSION }}-{{ .Environment.PLATFORM }}-node-modules-cache-{{ checksum "circle_cache_key" }} + key: v{{ .Environment.CACHE_VERSION }}-{{ checksum "platform_key" }}-node-modules-cache-{{ checksum "circle_cache_key" }} - run: name: Move node_modules back from /tmp command: | @@ -190,11 +193,14 @@ commands: - run: name: Generate Circle Cache key for system tests command: ./system-tests/scripts/cache-key.sh > system_tests_cache_key + - run: + name: Generate platform key + command: echo $PLATFORM > platform_key - restore_cache: name: Restore system tests node_modules cache keys: - - v{{ .Environment.CACHE_VERSION }}-{{ .Environment.PLATFORM }}-system-tests-projects-node-modules-cache-{{ checksum "system_tests_cache_key" }} - - v{{ .Environment.CACHE_VERSION }}-{{ .Environment.PLATFORM }}-system-tests-projects-node-modules-cache- + - v{{ .Environment.CACHE_VERSION }}-{{ checksum "platform_key" }}-system-tests-projects-node-modules-cache-{{ checksum "system_tests_cache_key" }} + - v{{ .Environment.CACHE_VERSION }}-{{ checksum "platform_key" }}-system-tests-projects-node-modules-cache- update_cached_system_tests_deps: description: 'Update the cached node_modules for projects in "system-tests/projects/**"' @@ -202,10 +208,13 @@ commands: - run: name: Generate Circle Cache key for system tests command: ./system-tests/scripts/cache-key.sh > system_tests_cache_key + - run: + name: Generate platform key + command: echo $PLATFORM > platform_key - restore_cache: name: Restore cache state, to check for known modules cache existence keys: - - v{{ .Environment.CACHE_VERSION }}-{{ .Environment.PLATFORM }}-system-tests-projects-node-modules-cache-state-{{ checksum "system_tests_cache_key" }} + - v{{ .Environment.CACHE_VERSION }}-{{ checksum "platform_key" }}-system-tests-projects-node-modules-cache-state-{{ checksum "system_tests_cache_key" }} - run: name: Send root honeycomb event for this CI build command: cd system-tests/scripts && node ./send-root-honecomb-event.js @@ -219,20 +228,20 @@ commands: - restore_cache: name: Restore system tests node_modules cache keys: - - v{{ .Environment.CACHE_VERSION }}-{{ .Environment.PLATFORM }}-system-tests-projects-node-modules-cache-{{ checksum "system_tests_cache_key" }} - - v{{ .Environment.CACHE_VERSION }}-{{ .Environment.PLATFORM }}-system-tests-projects-node-modules-cache- + - v{{ .Environment.CACHE_VERSION }}-{{ checksum "platform_key" }}-system-tests-projects-node-modules-cache-{{ checksum "system_tests_cache_key" }} + - v{{ .Environment.CACHE_VERSION }}-{{ checksum "platform_key" }}-system-tests-projects-node-modules-cache- - run: name: Update system-tests node_modules cache command: yarn workspace @tooling/system-tests projects:yarn:install - save_cache: name: Save system tests node_modules cache - key: v{{ .Environment.CACHE_VERSION }}-{{ .Environment.PLATFORM }}-system-tests-projects-node-modules-cache-{{ checksum "system_tests_cache_key" }} + key: v{{ .Environment.CACHE_VERSION }}-{{ checksum "platform_key" }}-system-tests-projects-node-modules-cache-{{ checksum "system_tests_cache_key" }} paths: - ~/.cache/cy-system-tests-node-modules - run: touch /tmp/system_tests_node_modules_installed - save_cache: name: Save system tests node_modules cache state key - key: v{{ .Environment.CACHE_VERSION }}-{{ .Environment.PLATFORM }}-system-tests-projects-node-modules-cache-state-{{ checksum "system_tests_cache_key" }} + key: v{{ .Environment.CACHE_VERSION }}-{{ checksum "platform_key" }}-system-tests-projects-node-modules-cache-state-{{ checksum "system_tests_cache_key" }} paths: - /tmp/system_tests_node_modules_installed @@ -247,9 +256,12 @@ commands: - run: name: Generate Circle Cache Key command: node scripts/circle-cache.js --action cacheKey > circle_cache_key + - run: + name: Generate platform key + command: echo $PLATFORM > platform_key - restore_cache: name: Restore cache state, to check for known modules cache existence - key: v{{ .Environment.CACHE_VERSION }}-{{ .Environment.PLATFORM }}-node-modules-cache-state-{{ checksum "circle_cache_key" }} + key: v{{ .Environment.CACHE_VERSION }}-{{ checksum "platform_key" }}-node-modules-cache-state-{{ checksum "circle_cache_key" }} - run: name: Bail if cache exists command: | @@ -261,7 +273,7 @@ commands: - restore_cache: name: Restore weekly yarn cache keys: - - v{{ .Environment.CACHE_VERSION }}-{{ .Environment.PLATFORM }}-deps-root-weekly-{{ checksum "cache_date" }} + - v{{ .Environment.CACHE_VERSION }}-{{ checksum "platform_key" }}-deps-root-weekly-{{ checksum "cache_date" }} - run: name: Install Node Modules command: | @@ -274,7 +286,7 @@ commands: steps: - save_cache: name: Saving node modules for root, cli, and all globbed workspace packages - key: v{{ .Environment.CACHE_VERSION }}-{{ .Environment.PLATFORM }}-node-modules-cache-{{ checksum "circle_cache_key" }} + key: v{{ .Environment.CACHE_VERSION }}-{{ checksum "platform_key" }}-node-modules-cache-{{ checksum "circle_cache_key" }} paths: - node_modules - cli/node_modules @@ -285,18 +297,18 @@ commands: steps: - save_cache: name: Saving node modules for root, cli, and all globbed workspace packages - key: v{{ .Environment.CACHE_VERSION }}-{{ .Environment.PLATFORM }}-node-modules-cache-{{ checksum "circle_cache_key" }} + key: v{{ .Environment.CACHE_VERSION }}-{{ checksum "platform_key" }}-node-modules-cache-{{ checksum "circle_cache_key" }} paths: - /tmp/node_modules_cache - run: touch /tmp/node_modules_installed - save_cache: name: Saving node-modules cache state key - key: v{{ .Environment.CACHE_VERSION }}-{{ .Environment.PLATFORM }}-node-modules-cache-state-{{ checksum "circle_cache_key" }} + key: v{{ .Environment.CACHE_VERSION }}-{{ checksum "platform_key" }}-node-modules-cache-state-{{ checksum "circle_cache_key" }} paths: - /tmp/node_modules_installed - save_cache: name: Save weekly yarn cache - key: v{{ .Environment.CACHE_VERSION }}-{{ .Environment.PLATFORM }}-deps-root-weekly-{{ checksum "cache_date" }} + key: v{{ .Environment.CACHE_VERSION }}-{{ checksum "platform_key" }}-deps-root-weekly-{{ checksum "cache_date" }} paths: - ~/.yarn