ci: cache Material node_modules
based on the lockfile checksum (#29417)
This will increase the cache hit rate for the `material-unit-tests` job. Related to https://github.com/angular/angular/pull/29416#discussion_r267321140. PR Close #29417
This commit is contained in:
parent
9a364a82fb
commit
fd122b0739
@ -573,15 +573,14 @@ jobs:
|
|||||||
steps:
|
steps:
|
||||||
- *attach_workspace
|
- *attach_workspace
|
||||||
- *init_environment
|
- *init_environment
|
||||||
- run:
|
|
||||||
name: "Determining SHA of Material Ivy branch"
|
|
||||||
command: git ls-remote ${MATERIAL_REPO_URL} ${MATERIAL_REPO_BRANCH} | cut -f1 > material_repo_sha
|
|
||||||
- run:
|
- run:
|
||||||
name: "Cloning Material repository"
|
name: "Cloning Material repository"
|
||||||
command: ./scripts/ci/clone_angular_material_repo.sh
|
command: ./scripts/ci/clone_angular_material_repo.sh
|
||||||
- restore_cache:
|
- restore_cache:
|
||||||
|
# Material directory must be kept in sync with the `$MATERIAL_REPO_TMP_DIR` env variable.
|
||||||
|
# It needs to be hardcoded here, because env variables interpolation is not supported.
|
||||||
keys:
|
keys:
|
||||||
- v2-angular-material-{{ checksum "material_repo_sha" }}
|
- v2-angular-material-{{ checksum "/tmp/material2/yarn.lock" }}
|
||||||
- v2-angular-material-
|
- v2-angular-material-
|
||||||
- run:
|
- run:
|
||||||
name: Installing Material dependencies.
|
name: Installing Material dependencies.
|
||||||
@ -590,9 +589,10 @@ jobs:
|
|||||||
# because we don't want to cache the node modules which have been modified to contain
|
# because we don't want to cache the node modules which have been modified to contain
|
||||||
# the attached Ivy package output.
|
# the attached Ivy package output.
|
||||||
- save_cache:
|
- save_cache:
|
||||||
key: v2-angular-material-{{ checksum "material_repo_sha" }}
|
# Material directory must be kept in sync with the `$MATERIAL_REPO_TMP_DIR` env variable.
|
||||||
|
# It needs to be hardcoded here, because env variables interpolation is not supported.
|
||||||
|
key: v2-angular-material-{{ checksum "/tmp/material2/yarn.lock" }}
|
||||||
paths:
|
paths:
|
||||||
# Needs to be hardcoded because environment variables are not interpolated here.
|
|
||||||
- "/tmp/material2/node_modules"
|
- "/tmp/material2/node_modules"
|
||||||
- run:
|
- run:
|
||||||
name: "Running Material unit tests"
|
name: "Running Material unit tests"
|
||||||
|
Loading…
x
Reference in New Issue
Block a user