test: bump material cache_key version (#34589)

Also add comment that cache_key version should be bumped when switching forks or branches and added a comment from @devversion explaining how the fallback cache key works.

PR Close #34589
This commit is contained in:
Greg Magolan 2020-01-06 19:12:38 -08:00 committed by atscott
parent d0400a1188
commit 0e52d9297f
2 changed files with 10 additions and 2 deletions

View File

@ -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"

View File

@ -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".