@@ -164,15 +164,35 @@ commands:
164164
165165 update_cached_system_tests_deps :
166166 steps :
167+ - run :
168+ name : Generate Circle Cache key for system tests
169+ command : yarn workspace @tooling/system-tests cache:key > system_tests_cache_key
170+ - restore_cache :
171+ name : Restore cache state, to check for known modules cache existence
172+ keys :
173+ - v{{ .Environment.CACHE_VERSION }}-{{ arch }}-system-tests-node-modules-cache-state-{{ checksum "system_tests_cache_key" }}
174+ - run :
175+ name : Bail if specific cache exists
176+ command : |
177+ if [[ -f "system_tests_node_modules_installed" ]]; then
178+ echo "No updates to system tests node modules, exiting"
179+ circleci-agent step halt
180+ fi
167181 - restore_cached_system_tests_deps
168182 - run :
169- name : Check+update system-tests node_modules cache
183+ name : Update system-tests node_modules cache
170184 command : yarn workspace @tooling/system-tests projects:yarn:install
171185 - save_cache :
172186 name : Save system tests node_modules cache
173187 key : v{{ .Environment.CACHE_VERSION }}-{{ arch }}-system-tests-node-modules-cache-{{ checksum "system_tests_cache_key" }}
174188 paths :
175189 - ~/.cache/cy-system-tests-node-modules
190+ - run : touch system_tests_node_modules_installed
191+ - save_cache :
192+ name : Save system tests node_modules cache state key
193+ key : v{{ .Environment.CACHE_VERSION }}-{{ arch }}-system-tests-node-modules-cache-state-{{ checksum "system_tests_cache_key" }}
194+ paths :
195+ - system_tests_node_modules_installed
176196
177197 caching-dependency-installer :
178198 description : ' Installs & caches the dependencies based on yarn lock & package json dependencies'
@@ -208,10 +228,6 @@ commands:
208228 . ./scripts/load-nvm.sh
209229 yarn --prefer-offline --frozen-lockfile --cache-folder ~/.yarn-<< parameters.arch >>
210230 no_output_timeout : 20m
211- - unless :
212- condition : <<parameters.is-mac>>
213- steps :
214- - update_cached_system_tests_deps
215231 - prepare-modules-cache :
216232 dont-move : <<parameters.is-mac>> # we don't move, so we don't hit any issues unpacking symlinks
217233 - when :
@@ -1113,6 +1129,12 @@ jobs:
11131129 path : /tmp/artifacts
11141130 - store-npm-logs
11151131
1132+ system-tests-node-modules-install :
1133+ << : *defaults
1134+ steps :
1135+ - restore_cached_workspace
1136+ - update_cached_system_tests_deps
1137+
11161138 system-tests-chrome :
11171139 << : *defaults
11181140 resource_class : medium
@@ -2048,19 +2070,26 @@ linux-workflow: &linux-workflow
20482070 - server-performance-tests :
20492071 requires :
20502072 - build
2073+ - system-tests-node-modules-install :
2074+ requires :
2075+ - build
20512076 - system-tests-chrome :
20522077 requires :
20532078 - build
2079+ - system-tests-node-modules-install
20542080 - system-tests-electron :
20552081 requires :
20562082 - build
2083+ - system-tests-node-modules-install
20572084 - system-tests-firefox :
20582085 requires :
20592086 - build
2087+ - system-tests-node-modules-install
20602088 - system-tests-non-root :
20612089 executor : non-root-docker-user
20622090 requires :
20632091 - build
2092+ - system-tests-node-modules-install
20642093 - driver-integration-tests-chrome :
20652094 requires :
20662095 - build
0 commit comments