@@ -123,6 +123,12 @@ var_17: &setup_bazel_binary
123
123
name : " Setting up global Bazel binary"
124
124
command : ./scripts/circleci/setup_bazel_binary.sh
125
125
126
+ # **Note**: When updating the beginning of the cache key, also update the fallback cache
127
+ # key to match the new cache key prefix. This allows us to take advantage of CircleCI's
128
+ # fallback caching. Read more here: https://circleci.com/docs/2.0/caching/#restoring-cache.
129
+ var_18 : &mdc_deps_cache_key v1-mdc-deps-{{ checksum "/tmp/material-components-web/package-lock.json" }}
130
+ var_19 : &mdc_deps_fallback_cache_key v1-mdc-deps-
131
+
126
132
# -----------------------------
127
133
# Container version of CircleCI
128
134
# -----------------------------
@@ -456,6 +462,53 @@ jobs:
456
462
- run : bazel build src/... --build_tag_filters=-docs-package,-e2e --define=compile=aot
457
463
- run : bazel test src/... --build_tag_filters=-docs-package,-e2e --test_tag_filters=-e2e --define=compile=aot
458
464
465
+ # ----------------------------------------------------------------------------
466
+ # Job that runs all Bazel tests against material-components-web#master.
467
+ # ----------------------------------------------------------------------------
468
+ mdc_snapshot_test_cronjob :
469
+ << : *job_defaults
470
+ resource_class : xlarge
471
+ environment :
472
+ GCP_DECRYPT_TOKEN : *gcp_decrypt_token
473
+ MDC_REPO_URL : " https://github.com/material-components/material-components-web.git"
474
+ MDC_REPO_BRANCH : " master"
475
+ MDC_REPO_TMP_DIR : " /tmp/material-components-web"
476
+ steps :
477
+ - *checkout_code
478
+ - *restore_cache
479
+ - *setup_bazel_binary
480
+ - *setup_bazel_ci_config
481
+ - *setup_bazel_remote_execution
482
+ - *yarn_download
483
+ - *yarn_install
484
+
485
+ - run : git clone ${MDC_REPO_URL} --branch ${MDC_REPO_BRANCH} --depth 1 ${MDC_REPO_TMP_DIR}
486
+ - restore_cache :
487
+ keys :
488
+ - *mdc_deps_cache_key
489
+ - *mdc_deps_fallback_cache_key
490
+ - run :
491
+ name : " Installing dependencies for MDC repository"
492
+ # MDC repository does not use Yarn for node dependencies, so in order to respect the
493
+ # lock-file we need to use "npm" when installing dependencies.
494
+ command : cd ${MDC_REPO_TMP_DIR} && npm install
495
+ - save_cache :
496
+ key : *mdc_deps_cache_key
497
+ paths :
498
+ # Repository path must be kept in sync with the `$MDC_REPO_TMP_DIR` env variable.
499
+ # It needs to be hardcoded here, because env variables interpolation is not supported.
500
+ - " /tmp/material-components-web/node_modules"
501
+ - run :
502
+ name : " Building MDC snapshot builds"
503
+ command : |
504
+ cd ${MDC_REPO_TMP_DIR}
505
+ yarn dist && node scripts/cp-pkgs.js
506
+ # Setup the components repository to use the MDC snapshot builds.
507
+ - run : node ./scripts/circleci/setup-mdc-snapshots.js ${MDC_REPO_TMP_DIR}/packages/ $(git -C ${MDC_REPO_TMP_DIR} rev-parse HEAD)
508
+ # Run project tests with the MDC snapshot builds.
509
+ - run : bazel build src/... --build_tag_filters=-docs-package,-e2e
510
+ - run : bazel test src/... --build_tag_filters=-docs-package,-e2e --test_tag_filters=-e2e
511
+
459
512
# ----------------------------------------------------------------------------------------
460
513
# Workflow definitions. A workflow usually groups multiple jobs together. This is useful if
461
514
# one job depends on another.
@@ -519,6 +572,7 @@ workflows:
519
572
# workflow. See: https://circleci.com/ideas/?idea=CCI-I-295
520
573
- snapshot_tests_local_browsers
521
574
- ivy_snapshot_test_cronjob
575
+ - mdc_snapshot_test_cronjob
522
576
triggers :
523
577
- schedule :
524
578
cron : " 0 * * * *"
0 commit comments