Skip to content

Commit 179ce89

Browse files
crisbetommalerba
authored andcommitted
build: only run snapshot tests against main branch (#22424)
Limits the various snapshot tests to only run against the main branch. They are very likely to main against the older branches, because by definition Angular's latest changes at HEAD might not be backwards-compatible. (cherry picked from commit 5f00365)
1 parent 84bde98 commit 179ce89

File tree

1 file changed

+15
-12
lines changed

1 file changed

+15
-12
lines changed

.circleci/config.yml

Lines changed: 15 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -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
# -----------------------------
@@ -696,7 +696,7 @@ workflows:
696696
requires:
697697
- build_release_packages
698698
- ngcc_compatibility_snapshot:
699-
filters: *skip_on_pull_requests_filter
699+
filters: *only_main_branch_filter
700700
requires:
701701
- build_release_packages
702702
- publish_snapshots:
@@ -711,9 +711,12 @@ workflows:
711711
# Note that we need additional jobs for the cronjob snapshot tests because there
712712
# is no easy way to detect whether a job runs inside of a cronjob or specific
713713
# workflow. See: https://circleci.com/ideas/?idea=CCI-I-295
714-
- snapshot_tests_local_browsers
715-
- view_engine_snapshot_test_cronjob
716-
- mdc_snapshot_test_cronjob
714+
- snapshot_tests_local_browsers:
715+
filters: *only_main_branch_filter
716+
- view_engine_snapshot_test_cronjob:
717+
filters: *only_main_branch_filter
718+
- mdc_snapshot_test_cronjob:
719+
filters: *only_main_branch_filter
717720

718721
triggers:
719722
- schedule:

0 commit comments

Comments
 (0)