77# To validate changes, use an online parser, eg.
88# http://yaml-online-parser.appspot.com/
99
10- var_1 : &docker_image circleci/node:12.9 .1
11- var_2 : &docker-firefox-image circleci/node:12.9 .1-browsers
10+ var_1 : &docker_image circleci/node:14.16 .1
11+ var_2 : &docker-firefox-image circleci/node:14.16 .1-browsers
1212
1313# **Note**: When updating the beginning of the cache key, also update the cache key to match
1414# the new cache key prefix. This allows us to take advantage of CircleCI's fallback caching.
1515# Read more here: https://circleci.com/docs/2.0/caching/#restoring-cache.
16- var_3 : &cache_key v6 -ng-mat-{{ checksum ".bazelversion" }}-{{ checksum "tools/postinstall/apply-patches.js" }}-{{ checksum "WORKSPACE" }}-{{ checksum "yarn.lock" }}
16+ var_3 : &cache_key v7 -ng-mat-{{ checksum ".bazelversion" }}-{{ checksum "tools/postinstall/apply-patches.js" }}-{{ checksum "WORKSPACE" }}-{{ checksum "yarn.lock" }}
1717# We want to invalidate the cache if the postinstall patches change. In order to apply new
1818# patches, a clean version of the node modules is needed. Additionally, we invalidate the cache
1919# if the Bazel version changes. We do this because otherwise the `bazelisk` cache folder will
2020# contain all previously used versions and ultimately cause the cache restoring to be slower.
21- var_4 : &cache_fallback_key v6 -ng-mat-{{ checksum ".bazelversion" }}-{{ checksum "tools/postinstall/apply-patches.js" }}-
21+ var_4 : &cache_fallback_key v7 -ng-mat-{{ checksum ".bazelversion" }}-{{ checksum "tools/postinstall/apply-patches.js" }}-
2222
2323# Settings common to each job
2424var_5 : &job_defaults
@@ -118,25 +118,25 @@ var_18: &setup_snapshot_builds
118118 name : " Setting up Angular snapshot builds"
119119 command : node ./scripts/circleci/setup-angular-snapshots.js master
120120
121- # Filter to skip a job on builds for pull requests.
122- var_19 : &skip_on_pull_requests_filter
123- branches :
124- ignore :
125- - /pull\/\d+/
126-
127121# Filter which ensures that jobs only run for pull requests.
128- var_20 : &only_on_pull_requests_filter
122+ var_19 : &only_on_pull_requests_filter
129123 branches :
130124 only :
131125 - /pull\/\d+/
132126
133127# Anchor for a step that notifies Slack when preceding steps failed.
134- var_21 : &slack_notify_on_failure
128+ var_20 : &slack_notify_on_failure
135129 run :
136130 name : " Notifying team about job failure"
137131 when : on_fail
138132 command : node ./scripts/circleci/notify-slack-job-failure.js
139133
134+ # Branch filter that only matches the main branch.
135+ var_21 : &only_main_branch_filter
136+ branches :
137+ only :
138+ - master
139+
140140# -----------------------------
141141# Container version of CircleCI
142142# -----------------------------
@@ -197,7 +197,8 @@ jobs:
197197
198198 # Exclude release and docs packages here as those will be built within
199199 # the "build_release_packages" and "publish_snapshots" jobs.
200- - run : bazel build src/... --build_tag_filters=-docs-package,-release-package
200+ # TODO(devversion): remove target exclusion once https://github.com/bazelbuild/rules_nodejs/pull/2646 is available.
201+ - run : bazel build --build_tag_filters=-docs-package,-release-package -- src/... -//src/e2e-app:devserver_with_linked_declarations.MF
201202 - *slack_notify_on_failure
202203
203204 # -----------------------------------
@@ -219,7 +220,8 @@ jobs:
219220
220221 # Exclude release and docs packages here as those will be built within
221222 # the "build_release_packages" and "publish_snapshots" jobs.
222- - run : bazel build src/... --build_tag_filters=-docs-package,-release-package --config=view-engine
223+ # TODO(devversion): remove target exclusion once https://github.com/bazelbuild/rules_nodejs/pull/2646 is available.
224+ - run : bazel build --build_tag_filters=-docs-package,-release-package --config=view-engine -- src/... -//src/e2e-app:devserver_with_linked_declarations.MF
223225 - *slack_notify_on_failure
224226
225227 # --------------------------------------------------------------------------------------------
@@ -281,7 +283,8 @@ jobs:
281283 - *yarn_install
282284 - *setup_bazel_binary
283285
284- - run : bazel test src/... --build_tag_filters=-e2e --test_tag_filters=-e2e --build_tests_only
286+ # TODO(devversion): remove target exclusion once https://github.com/bazelbuild/rules_nodejs/pull/2646 is available.
287+ - run : bazel test --build_tag_filters=-e2e --test_tag_filters=-e2e --build_tests_only -- src/... -//src/e2e-app:devserver_with_linked_declarations.MF
285288 - *slack_notify_on_failure
286289
287290 # ----------------------------------------------------------------------------
@@ -353,20 +356,21 @@ jobs:
353356 yarn check-entry-point-setup $(bazel info bazel-bin)/entry_points_manifest.json
354357
355358 - run : yarn ng-dev format changed --check << pipeline.git.base_revision >>
359+ - run : yarn ownerslint
360+ - run : yarn check-mdc-tests
361+ - run : yarn stylelint
362+ - run : yarn tslint
363+ - run : yarn -s ts-circular-deps:check
364+ - run : yarn check-mdc-exports
365+ # Should be last so that it doesn't prevent the other lint checks from running.
356366 - run :
357367 name : Check Commit Message (PR Only)
358368 # Only run the commit message checks on pull requests since we can't do
359369 # much about any failures that have made it into the main branch.
360370 command : |
361371 if [ -n "$CIRCLE_PR_NUMBER" ]; then
362- yarn ng-dev commit-message validate-range --range $CI_COMMIT_RANGE
372+ yarn ng-dev commit-message validate-range $CI_GIT_BASE_REVISION $CI_GIT_REVISION
363373 fi
364- - run : yarn ownerslint
365- - run : yarn check-mdc-tests
366- - run : yarn stylelint
367- - run : yarn tslint
368- - run : yarn -s ts-circular-deps:check
369- - run : yarn check-mdc-exports
370374
371375 - *slack_notify_on_failure
372376 - *save_cache
@@ -409,28 +413,6 @@ jobs:
409413 root : dist
410414 paths :
411415 - " releases/**/*"
412-
413- # Since there is no UMD bundle that includes everything from the CDK, we need to move
414- # all bundles into a directory. This allows us to store all CDK UMD bundles as job
415- # artifacts that can be picked up by the Angular Github bot.
416- - run :
417- name : Prepare CDK artifacts for publish.
418- command : |
419- mkdir -p /tmp/cdk-umd-minified-bundles
420- cp dist/releases/cdk/bundles/*.umd.min.js /tmp/cdk-umd-minified-bundles
421- # Publish bundle artifacts which will be used to calculate the size change.
422- # Note: Make sure that the size plugin from the Angular robot fetches the artifacts
423- # from this CircleCI job (see .github/angular-robot.yml). Additionally any artifacts need to
424- # be stored with the following path format: "{projectName}/{context}/{fileName}"
425- # This format is necessary because otherwise the bot is not able to pick up the
426- # artifacts from CircleCI. See:
427- # https://github.com/angular/github-robot/blob/master/functions/src/plugins/size.ts#L392-L394
428- - store_artifacts :
429- path : dist/releases/material/bundles/material.umd.min.js
430- destination : /angular_material/material_release_output/material.umd.min.js
431- - store_artifacts :
432- path : /tmp/cdk-umd-minified-bundles
433- destination : /angular_material/cdk_release_output/
434416 - *slack_notify_on_failure
435417
436418 upload_release_packages :
@@ -554,7 +536,8 @@ jobs:
554536 - *yarn_install_loose_lockfile
555537 - *setup_bazel_binary
556538
557- - run : bazel test src/... --build_tag_filters=-e2e --test_tag_filters=-e2e --build_tests_only
539+ # TODO(devversion): remove target exclusion once https://github.com/bazelbuild/rules_nodejs/pull/2646 is available.
540+ - run : bazel test --build_tag_filters=-e2e --test_tag_filters=-e2e --build_tests_only -- src/... -//src/e2e-app:devserver_with_linked_declarations.MF
558541 - *slack_notify_on_failure
559542
560543 # ----------------------------------------------------------------------------
@@ -575,7 +558,8 @@ jobs:
575558 - *setup_bazel_binary
576559
577560 # Run project tests with NGC and View Engine.
578- - run : bazel test src/... --build_tag_filters=-docs-package,-e2e --test_tag_filters=-e2e --config=view-engine --build_tests_only
561+ # TODO(devversion): remove target exclusion once https://github.com/bazelbuild/rules_nodejs/pull/2646 is available.
562+ - run : bazel test --build_tag_filters=-docs-package,-e2e --test_tag_filters=-e2e --config=view-engine --build_tests_only -- src/... -//src/e2e-app:devserver_with_linked_declarations.MF
579563 - *slack_notify_on_failure
580564
581565 # ----------------------------------------------------------------------------
@@ -596,7 +580,8 @@ jobs:
596580 - *setup_bazel_binary
597581
598582 # Run project tests with NGC and View Engine.
599- - run : bazel test src/... --build_tag_filters=-docs-package,-e2e --test_tag_filters=-e2e --config=view-engine --build_tests_only
583+ # TODO(devversion): remove target exclusion once https://github.com/bazelbuild/rules_nodejs/pull/2646 is available.
584+ - run : bazel test --build_tag_filters=-docs-package,-e2e --test_tag_filters=-e2e --config=view-engine --build_tests_only -- src/... -//src/e2e-app:devserver_with_linked_declarations.MF
600585 - *slack_notify_on_failure
601586
602587 # ----------------------------------------------------------------------------
@@ -614,6 +599,9 @@ jobs:
614599 - *setup_bazel_remote_execution
615600 - *yarn_install
616601 - *setup_bazel_binary
602+
603+ - run : yarn integration-tests:partial-ivy
604+ - run : yarn integration-tests:view-engine
617605 # TODO: Re-enable when there are integration tests that should run with Ivy.
618606 # Currently this command fails as there are no tests.
619607 # - run: yarn integration-tests
@@ -622,7 +610,26 @@ jobs:
622610 command : |
623611 # If the size integration tests fail, report the failure to a dedicated #components-ci-size-tracking Slack channel.
624612 yarn integration-tests:size-test || node ./scripts/circleci/notify-slack-job-failure.js components-ci-size-tracking
625- - run : yarn integration-tests:view-engine
613+ - *slack_notify_on_failure
614+
615+ # ----------------------------------------------------------------------------
616+ # Job that runs all integration tests against Angular snapshot builds.
617+ # ----------------------------------------------------------------------------
618+ integration_tests_snapshot :
619+ << : *job_defaults
620+ resource_class : xlarge
621+ environment :
622+ GCP_DECRYPT_TOKEN : *gcp_decrypt_token
623+ steps :
624+ - checkout_and_rebase
625+ - *restore_cache
626+ - *setup_bazel_ci_config
627+ - *setup_bazel_remote_execution
628+ - *setup_snapshot_builds
629+ - *yarn_install_loose_lockfile
630+ - *setup_bazel_binary
631+
632+ - run : yarn integration-tests:partial-ivy
626633 - *slack_notify_on_failure
627634
628635 # ----------------------------------------------------------------------------
@@ -636,17 +643,19 @@ jobs:
636643 steps :
637644 - checkout_and_rebase
638645 - *restore_cache
646+ - *yarn_install_loose_lockfile
639647 - *setup_bazel_binary
640648 - *setup_bazel_ci_config
641649 - *setup_bazel_remote_execution
642650 - *yarn_install
643651
644652 # Install the latest canary version of the "material-components-web".
645- - run : yarn add material-components-web@ canary
653+ - run : node ./scripts/circleci/setup-mdc- canary.js
646654
647655 # Setup the components repository to use the MDC snapshot builds.
648656 # Run project tests with the MDC canary builds.
649- - run : bazel test src/... --build_tag_filters=-docs-package,-e2e --test_tag_filters=-e2e --build_tests_only
657+ # TODO(devversion): remove target exclusion once https://github.com/bazelbuild/rules_nodejs/pull/2646 is available.
658+ - run : bazel test --build_tag_filters=-docs-package,-e2e --test_tag_filters=-e2e --build_tests_only -- src/... -//src/e2e-app:devserver_with_linked_declarations.MF
650659 - *slack_notify_on_failure
651660
652661# ----------------------------------------------------------------------------------------
@@ -694,7 +703,7 @@ workflows:
694703 requires :
695704 - build_release_packages
696705 - ngcc_compatibility_snapshot :
697- filters : *skip_on_pull_requests_filter
706+ filters : *only_main_branch_filter
698707 requires :
699708 - build_release_packages
700709 - publish_snapshots :
@@ -709,9 +718,14 @@ workflows:
709718 # Note that we need additional jobs for the cronjob snapshot tests because there
710719 # is no easy way to detect whether a job runs inside of a cronjob or specific
711720 # workflow. See: https://circleci.com/ideas/?idea=CCI-I-295
712- - snapshot_tests_local_browsers
713- - view_engine_snapshot_test_cronjob
714- - mdc_snapshot_test_cronjob
721+ - snapshot_tests_local_browsers :
722+ filters : *only_main_branch_filter
723+ - view_engine_snapshot_test_cronjob :
724+ filters : *only_main_branch_filter
725+ - mdc_snapshot_test_cronjob :
726+ filters : *only_main_branch_filter
727+ - integration_tests_snapshot :
728+ filters : *only_main_branch_filter
715729
716730 triggers :
717731 - schedule :
0 commit comments