diff --git a/.circleci/config.yml b/.circleci/config.yml index f582018562..5aac7430b4 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -29,8 +29,8 @@ var_4_win: &cache_key_win_fallback v5-angular-win-node-12.0- # Cache key for the Material unit tests job. **Note** when updating the SHA in the cache keys, # also update the SHA for the "MATERIAL_REPO_COMMIT" environment variable. -var_5: &material_unit_tests_cache_key v5-angular-material-9e7ba251207df77164d73d66620e619bcbc4d2ad -var_6: &material_unit_tests_cache_key_fallback v5-angular-material- +var_5: &material_unit_tests_cache_key v6-angular-material-9e7ba251207df77164d73d66620e619bcbc4d2ad +var_6: &material_unit_tests_cache_key_fallback v6-angular-material- # Workspace initially persisted by the `setup` job, and then enhanced by `build-npm-packages` and # `build-ivy-npm-packages`. @@ -752,6 +752,12 @@ jobs: - restore_cache: keys: - *material_unit_tests_cache_key + # Whenever the `angular/components` SHA is updated, the cache key will no longer match. The + # fallback cache will still match, and CircleCI will restore the most recently cached + # repository folder. Without the fallback cache, we'd need to download the repository + # from scratch and it would slow down the job. This is because we can't clone the + # repository with reduced "--depth", but rather need to clone the whole repository to be + # able to support arbitrary SHA's. - *material_unit_tests_cache_key_fallback - run: name: "Fetching Material repository" diff --git a/.circleci/env.sh b/.circleci/env.sh index 65b1c32783..e5eb23bdfb 100755 --- a/.circleci/env.sh +++ b/.circleci/env.sh @@ -72,6 +72,8 @@ setPublicVar SAUCE_READY_FILE_TIMEOUT 120 # completely isolated from angular/angular in order to avoid any bad interactions between # their separate build setups. setPublicVar MATERIAL_REPO_TMP_DIR "/tmp/material2" +# **NOTE**: When switching forks or branches, also bump the cache key & fallback cache key versions +# in the CircleCI "config.yml". setPublicVar MATERIAL_REPO_URL "https://github.com/angular/material2.git" setPublicVar MATERIAL_REPO_BRANCH "master" # **NOTE**: When updating the commit SHA, also update the cache key in the CircleCI "config.yml".