ci: use YAML aliases to define branch filters for CircleCI jobs (#33321)

PR Close #33321
This commit is contained in:
George Kalpakas 2019-10-22 14:30:09 +03:00 committed by Andrew Kushnir
parent 122f755b21
commit 22e483858e
1 changed files with 24 additions and 26 deletions

View File

@ -38,21 +38,26 @@ var_6: &material_unit_tests_cache_key_fallback v4-angular-material-
# https://circleci.com/blog/deep-diving-into-circleci-workspaces/
var_7: &workspace_location ~/
# Branch filter that can be specified for jobs that should only run on publish branches
# (e.g. master or the patch branch)
var_8: &publish_branches_filter
# Filter to run a job on builds for pull requests only.
var_8: &only_on_pull_requests
filters:
branches:
only:
- master
# e.g. 7.0.x, 7.1.x, etc.
- /\d+\.\d+\.x/
- /pull\/\d+/
# Filter to ignore pull requests on a given job.
var_9: &ignore_pull_requests
# Filter to skip a job on builds for pull requests.
var_9: &skip_on_pull_requests
filters:
branches:
ignore:
- /pull\/.*/
- /pull\/\d+/
# Filter to run a job on builds for the master branch only.
var_10: &only_on_master
filters:
branches:
only:
- master
# Executor Definitions
# https://circleci.com/docs/2.0/reusing-config/#authoring-reusable-executors
@ -775,15 +780,13 @@ workflows:
requires:
- setup
- test_saucelabs_bazel:
requires:
- setup
# This job is currently a PoC and a subset of `legacy-unit-tests-saucelabs`. Running on
# master only to avoid wasting resources.
#
# TODO: Run this job on all branches (including PRs) as soon as it is not a PoC.
filters:
branches:
only: master
<<: *only_on_master
requires:
- setup
- test_aio:
requires:
- setup
@ -810,12 +813,10 @@ workflows:
requires:
- build-ivy-npm-packages
- aio_preview:
# Only run on PR builds. (There can be no previews for non-PR builds.)
<<: *only_on_pull_requests
requires:
- setup
# Only run on PR builds. (There can be no previews for non-PR builds.)
filters:
branches:
only: /pull\/\d+/
- test_aio_preview:
requires:
- aio_preview
@ -857,11 +858,11 @@ workflows:
# This isn't strictly necessary as there is no artifact dependency, but helps economize
# CI resources by not attempting to build when we know should fail.
- test_win:
<<: *ignore_pull_requests
<<: *skip_on_pull_requests
requires:
- test
- test_ivy_aot_win:
<<: *ignore_pull_requests
<<: *skip_on_pull_requests
requires:
- test_ivy_aot
@ -876,9 +877,6 @@ workflows:
- setup
triggers:
- schedule:
<<: *only_on_master
# Runs AIO monitoring jobs at 10:00AM every day.
cron: "0 10 * * *"
filters:
branches:
only:
- master