ci: use CircleCI commands (#32745)
When we needed to run multiple commands in a reusable fashion, we needed to make a giant run block with multiple things inside. Using custom commands gives us a better way to do this. See https://circleci.com/docs/2.0/reusing-config/#authoring-reusable-commands for more info. PR Close #32745
This commit is contained in:
parent
1115961892
commit
296954041e
|
@ -27,58 +27,35 @@ var_4: &cache_key_fallback v3-angular-node-10.16-
|
||||||
var_3_win: &cache_key_win v4-angular-win-node-12.0-{{ checksum "yarn.lock" }}-{{ checksum "WORKSPACE" }}-{{ checksum "packages/bazel/package.bzl" }}-{{ checksum "aio/yarn.lock" }}
|
var_3_win: &cache_key_win v4-angular-win-node-12.0-{{ checksum "yarn.lock" }}-{{ checksum "WORKSPACE" }}-{{ checksum "packages/bazel/package.bzl" }}-{{ checksum "aio/yarn.lock" }}
|
||||||
var_4_win: &cache_key_win_fallback v4-angular-win-node-12.0-
|
var_4_win: &cache_key_win_fallback v4-angular-win-node-12.0-
|
||||||
|
|
||||||
# Initializes the CI environment by setting up common environment variables.
|
# Cache key for the Material unit tests job. **Note** when updating the SHA in the cache keys,
|
||||||
var_5: &init_environment
|
# also update the SHA for the "MATERIAL_REPO_COMMIT" environment variable.
|
||||||
run:
|
var_5: &material_unit_tests_cache_key v4-angular-material-2817c9e2faa4140342336987a692d5dd30bf24c2
|
||||||
name: Initializing environment (setting up variables, overwriting Yarn)
|
var_6: &material_unit_tests_cache_key_fallback v4-angular-material-
|
||||||
# Overwrite the yarn installed in the docker container with our own version.
|
|
||||||
command: |
|
|
||||||
./.circleci/env.sh
|
|
||||||
ourYarn=$(realpath ./third_party/github.com/yarnpkg/yarn/releases/download/v1.17.3/bin/yarn.js)
|
|
||||||
sudo chmod a+x $ourYarn
|
|
||||||
sudo ln -fs $ourYarn /usr/local/bin/yarn
|
|
||||||
echo "Yarn version: $(yarn --version)"
|
|
||||||
|
|
||||||
# Add GitHub to known hosts.
|
# Workspace initially persisted by the `setup` job, and then enhanced by `build-npm-packages` and
|
||||||
mkdir -p ~/.ssh
|
# `build-ivy-npm-packages`.
|
||||||
echo 'github.com ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAQEAq2A7hRGmdnm9tUDbO9IDSwBK6TbQa+PXYPCPy6rbTrTtw7PHkccKrpp0yVhp5HdEIcKr6pLlVDBfOLX9QUsyCOV0wzfjIJNlGEYsdlLJizHhbn2mUjvSAHQqZETYP81eFzLQNnPHt4EVVUh7VfDESU84KezmD5QlWpXLmvU31/yMf+Se8xhHTvKSCZIFImWwoG6mbUoWf9nzpIoaSjB+weqqUUmpaaasXVal72J+UX2B+2RPW3RcT0eOzQgqlJL3RKrTJvdsjE3JEAvGq3lGHSZXy28G3skua2SmVi/w4yCE6gbODqnTWlg7+wC604ydGXA8VJiS5ap43JXiUFFAaQ==' >> ~/.ssh/known_hosts
|
# https://circleci.com/docs/2.0/workflows/#using-workspaces-to-share-data-among-jobs
|
||||||
|
# https://circleci.com/blog/deep-diving-into-circleci-workspaces/
|
||||||
|
var_7: &workspace_location ~/
|
||||||
|
|
||||||
# use git+ssh instead of https
|
# Branch filter that can be specified for jobs that should only run on publish branches
|
||||||
git config --global url."ssh://git@github.com".insteadOf "https://github.com" || true
|
# (e.g. master or the patch branch)
|
||||||
git config --global gc.auto 0 || true
|
var_8: &publish_branches_filter
|
||||||
|
branches:
|
||||||
|
only:
|
||||||
|
- master
|
||||||
|
# e.g. 7.0.x, 7.1.x, etc.
|
||||||
|
- /\d+\.\d+\.x/
|
||||||
|
|
||||||
var_4_win: &init_environment_win
|
# Filter to ignore pull requests on a given job.
|
||||||
run:
|
var_9: &ignore_pull_requests
|
||||||
# Install Bazel pre-requisites that aren't in the preconfigured CircleCI Windows VM.
|
filters:
|
||||||
name: Setup windows node environment
|
branches:
|
||||||
command: ./.circleci/windows-env.ps1
|
ignore:
|
||||||
|
- /pull\/.*/
|
||||||
|
|
||||||
var_6: &setup_bazel_remote_execution
|
# TODO: move these anchors into a windows setup job when CircleCI fixes cache/workflows on win.
|
||||||
run:
|
var_8_win: &post_checkout_win
|
||||||
name: "Setup bazel RBE remote execution"
|
|
||||||
command: |
|
|
||||||
# We need ensure that the same default digest is used for encoding and decoding
|
|
||||||
# with openssl. Openssl versions might have different default digests which can
|
|
||||||
# cause decryption failures based on the openssl version. https://stackoverflow.com/a/39641378/4317734
|
|
||||||
openssl aes-256-cbc -d -in .circleci/gcp_token -md md5 -k "$CI_REPO_NAME" -out /home/circleci/.gcp_credentials
|
|
||||||
echo "export GOOGLE_APPLICATION_CREDENTIALS=/home/circleci/.gcp_credentials" >> $BASH_ENV
|
|
||||||
./.circleci/setup-rbe.sh .bazelrc.user
|
|
||||||
|
|
||||||
# After checkout, rebase on top of target branch.
|
|
||||||
var_7: &post_checkout
|
|
||||||
run:
|
|
||||||
name: Rebase PR on target branch
|
|
||||||
command: >
|
|
||||||
if [[ -n "${CIRCLE_PR_NUMBER}" ]]; then
|
|
||||||
# User is required for rebase.
|
|
||||||
git config user.name "angular-ci"
|
|
||||||
git config user.email "angular-ci"
|
|
||||||
# Rebase PR on top of target branch.
|
|
||||||
node tools/rebase-pr.js angular/angular ${CIRCLE_PR_NUMBER}
|
|
||||||
else
|
|
||||||
echo "This build is not over a PR, nothing to do."
|
|
||||||
fi
|
|
||||||
var_7_win: &post_checkout_win
|
|
||||||
run:
|
run:
|
||||||
name: Rebase PR on target branch
|
name: Rebase PR on target branch
|
||||||
command: >
|
command: >
|
||||||
|
@ -90,80 +67,12 @@ var_7_win: &post_checkout_win
|
||||||
echo "This build is not over a PR, nothing to do."
|
echo "This build is not over a PR, nothing to do."
|
||||||
}
|
}
|
||||||
|
|
||||||
var_8: &yarn_install
|
|
||||||
run:
|
|
||||||
name: Running Yarn install
|
|
||||||
command: |
|
|
||||||
# Yarn's requests sometimes take more than 10mins to complete.
|
|
||||||
# Print something to stdout, to prevent CircleCI from failing due to not output.
|
|
||||||
while true; do sleep 60; echo "[`date`] Keeping alive..."; done &
|
|
||||||
KEEP_ALIVE_PID=$!
|
|
||||||
yarn install --frozen-lockfile --non-interactive
|
|
||||||
kill $KEEP_ALIVE_PID
|
|
||||||
|
|
||||||
var_9: &setup_circleci_bazel_config
|
|
||||||
run:
|
|
||||||
name: Setting up CircleCI bazel configuration
|
|
||||||
command: sudo cp .circleci/bazel.linux.rc $HOME/.bazelrc
|
|
||||||
|
|
||||||
var_9_win: &setup_circleci_bazel_config_win
|
|
||||||
run:
|
|
||||||
name: Setting up CircleCI bazel configuration
|
|
||||||
command: copy .circleci\bazel.windows.rc $env:USERPROFILE\.bazelrc
|
|
||||||
|
|
||||||
var_10: &restore_cache
|
|
||||||
restore_cache:
|
|
||||||
keys:
|
|
||||||
- *cache_key
|
|
||||||
- *cache_key_fallback
|
|
||||||
var_10_win: &restore_cache_win
|
var_10_win: &restore_cache_win
|
||||||
restore_cache:
|
restore_cache:
|
||||||
keys:
|
keys:
|
||||||
- *cache_key_win
|
- *cache_key_win
|
||||||
- *cache_key_fallback_win
|
- *cache_key_fallback_win
|
||||||
|
|
||||||
# Branch filter that can be specified for jobs that should only run on publish branches
|
|
||||||
# (e.g. master or the patch branch)
|
|
||||||
var_11: &publish_branches_filter
|
|
||||||
branches:
|
|
||||||
only:
|
|
||||||
- master
|
|
||||||
# e.g. 7.0.x, 7.1.x, etc.
|
|
||||||
- /\d+\.\d+\.x/
|
|
||||||
|
|
||||||
# Workspace initially persisted by the `install` job, and then enhanced by `test_aio` and
|
|
||||||
# `build-npm-packages`.
|
|
||||||
# https://circleci.com/docs/2.0/workflows/#using-workspaces-to-share-data-among-jobs
|
|
||||||
# https://circleci.com/blog/deep-diving-into-circleci-workspaces/
|
|
||||||
var_12: &attach_workspace
|
|
||||||
attach_workspace:
|
|
||||||
at: ~/
|
|
||||||
|
|
||||||
var_13: ¬ify_caretaker_on_fail
|
|
||||||
run:
|
|
||||||
when: on_fail
|
|
||||||
name: Notify caretaker about failure
|
|
||||||
# `$SLACK_CARETAKER_WEBHOOK_URL` is a secret env var defined in CircleCI project settings.
|
|
||||||
# The URL comes from https://angular-team.slack.com/apps/A0F7VRE7N-circleci.
|
|
||||||
command: |
|
|
||||||
notificationJson="{\"text\":\":x: \`$CIRCLE_JOB\` job for $CIRCLE_BRANCH branch failed on build $CIRCLE_BUILD_NUM: $CIRCLE_BUILD_URL :scream:\"}"
|
|
||||||
curl --request POST --header "Content-Type: application/json" --data "$notificationJson" $SLACK_CARETAKER_WEBHOOK_URL
|
|
||||||
|
|
||||||
var_14: ¬ify_dev_infra_on_fail
|
|
||||||
run:
|
|
||||||
when: on_fail
|
|
||||||
name: Notify dev-infra about failure
|
|
||||||
# `$SLACK_DEV_INFRA_CI_FAILURES_WEBHOOK_URL` is a secret env var defined in CircleCI project settings.
|
|
||||||
# The URL comes from https://angular-team.slack.com/apps/A0F7VRE7N-circleci.
|
|
||||||
command: |
|
|
||||||
notificationJson="{\"text\":\":x: \`$CIRCLE_JOB\` job for $CIRCLE_BRANCH branch failed on build $CIRCLE_BUILD_NUM: $CIRCLE_BUILD_URL :scream:\"}"
|
|
||||||
curl --request POST --header "Content-Type: application/json" --data "$notificationJson" $SLACK_DEV_INFRA_CI_FAILURES_WEBHOOK_URL
|
|
||||||
|
|
||||||
# Cache key for the Material unit tests job. **Note** when updating the SHA in the cache keys,
|
|
||||||
# also update the SHA for the "MATERIAL_REPO_COMMIT" environment variable.
|
|
||||||
var_15: &material_unit_tests_cache_key v4-angular-material-2817c9e2faa4140342336987a692d5dd30bf24c2
|
|
||||||
var_16: &material_unit_tests_cache_key_short v4-angular-material
|
|
||||||
|
|
||||||
|
|
||||||
# Executor Definitions
|
# Executor Definitions
|
||||||
# https://circleci.com/docs/2.0/reusing-config/#authoring-reusable-executors
|
# https://circleci.com/docs/2.0/reusing-config/#authoring-reusable-executors
|
||||||
|
@ -217,16 +126,114 @@ executors:
|
||||||
# - Python 3 3.7.4
|
# - Python 3 3.7.4
|
||||||
image: windows-server-2019-vs2019:201908-02
|
image: windows-server-2019-vs2019:201908-02
|
||||||
|
|
||||||
|
# Command Definitions
|
||||||
|
# https://circleci.com/docs/2.0/reusing-config/#authoring-reusable-commands
|
||||||
|
commands:
|
||||||
|
custom_attach_workspace:
|
||||||
|
description: Attach workspace at a predefined location
|
||||||
|
steps:
|
||||||
|
- attach_workspace:
|
||||||
|
at: *workspace_location
|
||||||
|
|
||||||
|
# Initializes the CI environment by setting up common environment variables.
|
||||||
|
init_environment:
|
||||||
|
description: Initializing environment (setting up variables, overwriting Yarn)
|
||||||
|
steps:
|
||||||
|
- run: ./.circleci/env.sh
|
||||||
|
# Overwrite the yarn installed in the docker container with our own version.
|
||||||
|
- run: |
|
||||||
|
ourYarn=$(realpath ./third_party/github.com/yarnpkg/yarn/releases/download/v1.17.3/bin/yarn.js)
|
||||||
|
sudo chmod a+x $ourYarn
|
||||||
|
sudo ln -fs $ourYarn /usr/local/bin/yarn
|
||||||
|
- run: echo "Yarn version $(yarn --version)"
|
||||||
|
# Configure git as the CircleCI `checkout` command does.
|
||||||
|
# This is needed because we only checkout on the setup job.
|
||||||
|
# Add GitHub to known hosts
|
||||||
|
- run: mkdir -p ~/.ssh
|
||||||
|
- run: echo 'github.com ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAQEAq2A7hRGmdnm9tUDbO9IDSwBK6TbQa+PXYPCPy6rbTrTtw7PHkccKrpp0yVhp5HdEIcKr6pLlVDBfOLX9QUsyCOV0wzfjIJNlGEYsdlLJizHhbn2mUjvSAHQqZETYP81eFzLQNnPHt4EVVUh7VfDESU84KezmD5QlWpXLmvU31/yMf+Se8xhHTvKSCZIFImWwoG6mbUoWf9nzpIoaSjB+weqqUUmpaaasXVal72J+UX2B+2RPW3RcT0eOzQgqlJL3RKrTJvdsjE3JEAvGq3lGHSZXy28G3skua2SmVi/w4yCE6gbODqnTWlg7+wC604ydGXA8VJiS5ap43JXiUFFAaQ==' >> ~/.ssh/known_hosts
|
||||||
|
- run: git config --global url."ssh://git@github.com".insteadOf "https://github.com" || true
|
||||||
|
- run: git config --global gc.auto 0 || true
|
||||||
|
|
||||||
|
init_environment_win:
|
||||||
|
description: Setup windows node environment
|
||||||
|
steps:
|
||||||
|
# Install Bazel pre-requisites that aren't in the preconfigured CircleCI Windows VM.
|
||||||
|
- run: ./.circleci/windows-env.ps1
|
||||||
|
- run: node --version
|
||||||
|
- run: yarn --version
|
||||||
|
|
||||||
|
setup_circleci_bazel_config:
|
||||||
|
description: Set up CircleCI bazel configuration on Linux
|
||||||
|
steps:
|
||||||
|
- run: sudo cp .circleci/bazel.linux.rc $HOME/.bazelrc
|
||||||
|
|
||||||
|
setup_circleci_bazel_config_win:
|
||||||
|
description: Set up CircleCI bazel configuration on Windows
|
||||||
|
steps:
|
||||||
|
- run: copy .circleci\bazel.windows.rc $env:USERPROFILE\.bazelrc
|
||||||
|
|
||||||
|
setup_bazel_rbe:
|
||||||
|
description: Setup bazel RBE remote execution
|
||||||
|
steps:
|
||||||
|
# We need ensure that the same default digest is used for encoding and decoding
|
||||||
|
# with openssl. Openssl versions might have different default digests which can
|
||||||
|
# cause decryption failures based on the openssl version. https://stackoverflow.com/a/39641378/4317734
|
||||||
|
- run: openssl aes-256-cbc -d -in .circleci/gcp_token -md md5 -k "$CI_REPO_NAME" -out /home/circleci/.gcp_credentials
|
||||||
|
- run: echo "export GOOGLE_APPLICATION_CREDENTIALS=/home/circleci/.gcp_credentials" >> $BASH_ENV
|
||||||
|
- run: ./.circleci/setup-rbe.sh .bazelrc.user
|
||||||
|
|
||||||
|
notify_caretaker_on_fail:
|
||||||
|
description: Notify caretaker about failure
|
||||||
|
steps:
|
||||||
|
- run:
|
||||||
|
when: on_fail
|
||||||
|
# `$SLACK_CARETAKER_WEBHOOK_URL` is a secret env var defined in CircleCI project settings.
|
||||||
|
# The URL comes from https://angular-team.slack.com/apps/A0F7VRE7N-circleci.
|
||||||
|
command: |
|
||||||
|
notificationJson="{\"text\":\":x: \`$CIRCLE_JOB\` job for $CIRCLE_BRANCH branch failed on build $CIRCLE_BUILD_NUM: $CIRCLE_BUILD_URL :scream:\"}"
|
||||||
|
curl --request POST --header "Content-Type: application/json" --data "$notificationJson" $SLACK_CARETAKER_WEBHOOK_URL
|
||||||
|
|
||||||
|
notify_dev_infra_on_fail:
|
||||||
|
description: Notify dev-infra about failure
|
||||||
|
steps:
|
||||||
|
- run:
|
||||||
|
when: on_fail
|
||||||
|
# `$SLACK_DEV_INFRA_CI_FAILURES_WEBHOOK_URL` is a secret env var defined in CircleCI project settings.
|
||||||
|
# The URL comes from https://angular-team.slack.com/apps/A0F7VRE7N-circleci.
|
||||||
|
command: |
|
||||||
|
notificationJson="{\"text\":\":x: \`$CIRCLE_JOB\` job for $CIRCLE_BRANCH branch failed on build $CIRCLE_BUILD_NUM: $CIRCLE_BUILD_URL :scream:\"}"
|
||||||
|
curl --request POST --header "Content-Type: application/json" --data "$notificationJson" $SLACK_DEV_INFRA_CI_FAILURES_WEBHOOK_URL
|
||||||
|
|
||||||
|
# Job definitions
|
||||||
jobs:
|
jobs:
|
||||||
setup:
|
setup:
|
||||||
executor: action-executor
|
executor: action-executor
|
||||||
steps:
|
steps:
|
||||||
- checkout
|
- checkout
|
||||||
- *post_checkout
|
- run:
|
||||||
|
name: Rebase PR on target branch
|
||||||
|
# After checkout, rebase on top of target branch.
|
||||||
|
command: >
|
||||||
|
if [[ -n "${CIRCLE_PR_NUMBER}" ]]; then
|
||||||
|
# User is required for rebase.
|
||||||
|
git config user.name "angular-ci"
|
||||||
|
git config user.email "angular-ci"
|
||||||
|
# Rebase PR on top of target branch.
|
||||||
|
node tools/rebase-pr.js angular/angular ${CIRCLE_PR_NUMBER}
|
||||||
|
else
|
||||||
|
echo "This build is not over a PR, nothing to do."
|
||||||
|
fi
|
||||||
# This cache is saved in the build-npm-packages so that Bazel cache is also included.
|
# This cache is saved in the build-npm-packages so that Bazel cache is also included.
|
||||||
- *restore_cache
|
- restore_cache:
|
||||||
- *init_environment
|
keys:
|
||||||
- *yarn_install
|
- *cache_key
|
||||||
|
- *cache_key_fallback
|
||||||
|
- init_environment
|
||||||
|
- run:
|
||||||
|
name: Running Yarn install
|
||||||
|
command: yarn install --frozen-lockfile --non-interactive
|
||||||
|
# Yarn's requests sometimes take more than 10mins to complete.
|
||||||
|
no_output_timeout: 45m
|
||||||
- run: yarn --cwd aio install --frozen-lockfile --non-interactive
|
- run: yarn --cwd aio install --frozen-lockfile --non-interactive
|
||||||
# Make the bazel directories and add a file to them if they don't exist already so that
|
# Make the bazel directories and add a file to them if they don't exist already so that
|
||||||
# persist_to_workspace does not fail.
|
# persist_to_workspace does not fail.
|
||||||
|
@ -236,10 +243,9 @@ jobs:
|
||||||
touch ~/bazel_repository_cache/MARKER
|
touch ~/bazel_repository_cache/MARKER
|
||||||
fi
|
fi
|
||||||
# Persist any changes at this point to be reused by further jobs.
|
# Persist any changes at this point to be reused by further jobs.
|
||||||
# **NOTE 1 **: Folders persisted here should be kept in sync with `var_13: &attach_workspace`.
|
# **NOTE**: To add new content to the workspace, always persist on the same root.
|
||||||
# **NOTE 2 **: To add new content to the workspace, always persist on the same root.
|
|
||||||
- persist_to_workspace:
|
- persist_to_workspace:
|
||||||
root: ~/
|
root: *workspace_location
|
||||||
paths:
|
paths:
|
||||||
- ./ng
|
- ./ng
|
||||||
- ./bazel_repository_cache
|
- ./bazel_repository_cache
|
||||||
|
@ -247,8 +253,8 @@ jobs:
|
||||||
lint:
|
lint:
|
||||||
executor: action-executor
|
executor: action-executor
|
||||||
steps:
|
steps:
|
||||||
- *attach_workspace
|
- custom_attach_workspace
|
||||||
- *init_environment
|
- init_environment
|
||||||
|
|
||||||
- run: 'yarn bazel:format -mode=check ||
|
- run: 'yarn bazel:format -mode=check ||
|
||||||
(echo "BUILD files not formatted. Please run ''yarn bazel:format''" ; exit 1)'
|
(echo "BUILD files not formatted. Please run ''yarn bazel:format''" ; exit 1)'
|
||||||
|
@ -264,11 +270,11 @@ jobs:
|
||||||
name: action-executor
|
name: action-executor
|
||||||
resource_class: xlarge
|
resource_class: xlarge
|
||||||
steps:
|
steps:
|
||||||
- *attach_workspace
|
- custom_attach_workspace
|
||||||
- *init_environment
|
- init_environment
|
||||||
- *setup_circleci_bazel_config
|
- setup_circleci_bazel_config
|
||||||
# Setup remote execution and run RBE-compatible tests.
|
# Setup remote execution and run RBE-compatible tests.
|
||||||
- *setup_bazel_remote_execution
|
- setup_bazel_rbe
|
||||||
- run:
|
- run:
|
||||||
command: yarn bazel test //... --build_tag_filters=-ivy-only --test_tag_filters=-ivy-only
|
command: yarn bazel test //... --build_tag_filters=-ivy-only --test_tag_filters=-ivy-only
|
||||||
no_output_timeout: 20m
|
no_output_timeout: 20m
|
||||||
|
@ -279,10 +285,10 @@ jobs:
|
||||||
name: action-executor
|
name: action-executor
|
||||||
resource_class: xlarge
|
resource_class: xlarge
|
||||||
steps:
|
steps:
|
||||||
- *attach_workspace
|
- custom_attach_workspace
|
||||||
- *init_environment
|
- init_environment
|
||||||
- *setup_circleci_bazel_config
|
- setup_circleci_bazel_config
|
||||||
- *setup_bazel_remote_execution
|
- setup_bazel_rbe
|
||||||
|
|
||||||
# We need to explicitly specify the --symlink_prefix option because otherwise we would
|
# We need to explicitly specify the --symlink_prefix option because otherwise we would
|
||||||
# not be able to easily find the output bin directory when uploading artifacts for size
|
# not be able to easily find the output bin directory when uploading artifacts for size
|
||||||
|
@ -323,10 +329,10 @@ jobs:
|
||||||
# and therefore the tunnel and Karma need to process a lot of file requests and tests.
|
# and therefore the tunnel and Karma need to process a lot of file requests and tests.
|
||||||
resource_class: xlarge
|
resource_class: xlarge
|
||||||
steps:
|
steps:
|
||||||
- *attach_workspace
|
- custom_attach_workspace
|
||||||
- *init_environment
|
- init_environment
|
||||||
- *setup_circleci_bazel_config
|
- setup_circleci_bazel_config
|
||||||
- *setup_bazel_remote_execution
|
- setup_bazel_rbe
|
||||||
- run:
|
- run:
|
||||||
name: Run Bazel tests in saucelabs
|
name: Run Bazel tests in saucelabs
|
||||||
# All web tests are contained within a single //:test_web_all target for Saucelabs
|
# All web tests are contained within a single //:test_web_all target for Saucelabs
|
||||||
|
@ -342,14 +348,14 @@ jobs:
|
||||||
--key $(echo $SAUCE_ACCESS_KEY | rev) \
|
--key $(echo $SAUCE_ACCESS_KEY | rev) \
|
||||||
yarn bazel test //:test_web_all
|
yarn bazel test //:test_web_all
|
||||||
no_output_timeout: 20m
|
no_output_timeout: 20m
|
||||||
- *notify_dev_infra_on_fail
|
- notify_dev_infra_on_fail
|
||||||
|
|
||||||
test_aio:
|
test_aio:
|
||||||
# Needed because the AIO tests and the PWA score test depend on Chrome being available.
|
# Needed because the AIO tests and the PWA score test depend on Chrome being available.
|
||||||
executor: browsers-executor
|
executor: browsers-executor
|
||||||
steps:
|
steps:
|
||||||
- *attach_workspace
|
- custom_attach_workspace
|
||||||
- *init_environment
|
- init_environment
|
||||||
# Build aio
|
# Build aio
|
||||||
- run: yarn --cwd aio build --progress=false
|
- run: yarn --cwd aio build --progress=false
|
||||||
# Lint the code
|
# Lint the code
|
||||||
|
@ -371,8 +377,8 @@ jobs:
|
||||||
# Needed because before deploying the deploy-production script runs the PWA score tests.
|
# Needed because before deploying the deploy-production script runs the PWA score tests.
|
||||||
executor: browsers-executor
|
executor: browsers-executor
|
||||||
steps:
|
steps:
|
||||||
- *attach_workspace
|
- custom_attach_workspace
|
||||||
- *init_environment
|
- init_environment
|
||||||
# Deploy angular.io to production (if necessary)
|
# Deploy angular.io to production (if necessary)
|
||||||
- run: setPublicVar_CI_STABLE_BRANCH
|
- run: setPublicVar_CI_STABLE_BRANCH
|
||||||
- run: yarn --cwd aio deploy-production
|
- run: yarn --cwd aio deploy-production
|
||||||
|
@ -381,8 +387,8 @@ jobs:
|
||||||
# Needed because the AIO tests and the PWA score test depend on Chrome being available.
|
# Needed because the AIO tests and the PWA score test depend on Chrome being available.
|
||||||
executor: browsers-executor
|
executor: browsers-executor
|
||||||
steps:
|
steps:
|
||||||
- *attach_workspace
|
- custom_attach_workspace
|
||||||
- *init_environment
|
- init_environment
|
||||||
# Build aio (with local Angular packages)
|
# Build aio (with local Angular packages)
|
||||||
- run: yarn --cwd aio build-local-ci
|
- run: yarn --cwd aio build-local-ci
|
||||||
# Run unit tests
|
# Run unit tests
|
||||||
|
@ -398,8 +404,8 @@ jobs:
|
||||||
# Needed because the AIO tests and the PWA score test depend on Chrome being available.
|
# Needed because the AIO tests and the PWA score test depend on Chrome being available.
|
||||||
executor: browsers-executor
|
executor: browsers-executor
|
||||||
steps:
|
steps:
|
||||||
- *attach_workspace
|
- custom_attach_workspace
|
||||||
- *init_environment
|
- init_environment
|
||||||
# Build aio with Ivy (using local Angular packages)
|
# Build aio with Ivy (using local Angular packages)
|
||||||
- run: yarn --cwd aio build-with-ivy-ci
|
- run: yarn --cwd aio build-with-ivy-ci
|
||||||
# Run unit tests
|
# Run unit tests
|
||||||
|
@ -414,8 +420,8 @@ jobs:
|
||||||
test_aio_tools:
|
test_aio_tools:
|
||||||
executor: action-executor
|
executor: action-executor
|
||||||
steps:
|
steps:
|
||||||
- *attach_workspace
|
- custom_attach_workspace
|
||||||
- *init_environment
|
- init_environment
|
||||||
# Install
|
# Install
|
||||||
- run: yarn --cwd aio install --frozen-lockfile --non-interactive
|
- run: yarn --cwd aio install --frozen-lockfile --non-interactive
|
||||||
- run: yarn --cwd aio extract-cli-command-docs
|
- run: yarn --cwd aio extract-cli-command-docs
|
||||||
|
@ -430,8 +436,8 @@ jobs:
|
||||||
resource_class: xlarge
|
resource_class: xlarge
|
||||||
parallelism: 4
|
parallelism: 4
|
||||||
steps:
|
steps:
|
||||||
- *attach_workspace
|
- custom_attach_workspace
|
||||||
- *init_environment
|
- init_environment
|
||||||
# Install aio
|
# Install aio
|
||||||
- run: yarn --cwd aio install --frozen-lockfile --non-interactive
|
- run: yarn --cwd aio install --frozen-lockfile --non-interactive
|
||||||
# Run examples tests. The "CIRCLE_NODE_INDEX" will be set if "parallelism" is enabled.
|
# Run examples tests. The "CIRCLE_NODE_INDEX" will be set if "parallelism" is enabled.
|
||||||
|
@ -449,8 +455,8 @@ jobs:
|
||||||
# takes up more time and we don't want these jobs to impact the overall CI turnaround.
|
# takes up more time and we don't want these jobs to impact the overall CI turnaround.
|
||||||
parallelism: 5
|
parallelism: 5
|
||||||
steps:
|
steps:
|
||||||
- *attach_workspace
|
- custom_attach_workspace
|
||||||
- *init_environment
|
- init_environment
|
||||||
# Install aio
|
# Install aio
|
||||||
- run: yarn --cwd aio install --frozen-lockfile --non-interactive
|
- run: yarn --cwd aio install --frozen-lockfile --non-interactive
|
||||||
# Rename the Ivy packages dist folder to "dist/packages-dist" as the AIO
|
# Rename the Ivy packages dist folder to "dist/packages-dist" as the AIO
|
||||||
|
@ -470,8 +476,8 @@ jobs:
|
||||||
environment:
|
environment:
|
||||||
AIO_SNAPSHOT_ARTIFACT_PATH: &aio_preview_artifact_path 'aio/tmp/snapshot.tgz'
|
AIO_SNAPSHOT_ARTIFACT_PATH: &aio_preview_artifact_path 'aio/tmp/snapshot.tgz'
|
||||||
steps:
|
steps:
|
||||||
- *attach_workspace
|
- custom_attach_workspace
|
||||||
- *init_environment
|
- init_environment
|
||||||
- run: ./aio/scripts/build-artifacts.sh $AIO_SNAPSHOT_ARTIFACT_PATH $CI_PULL_REQUEST $CI_COMMIT
|
- run: ./aio/scripts/build-artifacts.sh $AIO_SNAPSHOT_ARTIFACT_PATH $CI_PULL_REQUEST $CI_COMMIT
|
||||||
- store_artifacts:
|
- store_artifacts:
|
||||||
path: *aio_preview_artifact_path
|
path: *aio_preview_artifact_path
|
||||||
|
@ -485,8 +491,8 @@ jobs:
|
||||||
# Needed because the test-preview script runs e2e tests and the PWA score test with Chrome.
|
# Needed because the test-preview script runs e2e tests and the PWA score test with Chrome.
|
||||||
executor: browsers-executor
|
executor: browsers-executor
|
||||||
steps:
|
steps:
|
||||||
- *attach_workspace
|
- custom_attach_workspace
|
||||||
- *init_environment
|
- init_environment
|
||||||
- run: yarn --cwd aio install --frozen-lockfile --non-interactive
|
- run: yarn --cwd aio install --frozen-lockfile --non-interactive
|
||||||
- run:
|
- run:
|
||||||
name: Wait for preview and run tests
|
name: Wait for preview and run tests
|
||||||
|
@ -506,16 +512,16 @@ jobs:
|
||||||
name: action-executor
|
name: action-executor
|
||||||
resource_class: xlarge
|
resource_class: xlarge
|
||||||
steps:
|
steps:
|
||||||
- *attach_workspace
|
- custom_attach_workspace
|
||||||
- *init_environment
|
- init_environment
|
||||||
- *setup_circleci_bazel_config
|
- setup_circleci_bazel_config
|
||||||
- *setup_bazel_remote_execution
|
- setup_bazel_rbe
|
||||||
|
|
||||||
- run: scripts/build-packages-dist.sh
|
- run: scripts/build-packages-dist.sh
|
||||||
|
|
||||||
# Save the npm packages from //packages/... for other workflow jobs to read
|
# Save the npm packages from //packages/... for other workflow jobs to read
|
||||||
- persist_to_workspace:
|
- persist_to_workspace:
|
||||||
root: ~/
|
root: *workspace_location
|
||||||
paths:
|
paths:
|
||||||
- ng/dist/packages-dist
|
- ng/dist/packages-dist
|
||||||
|
|
||||||
|
@ -533,16 +539,16 @@ jobs:
|
||||||
name: action-executor
|
name: action-executor
|
||||||
resource_class: xlarge
|
resource_class: xlarge
|
||||||
steps:
|
steps:
|
||||||
- *attach_workspace
|
- custom_attach_workspace
|
||||||
- *init_environment
|
- init_environment
|
||||||
- *setup_circleci_bazel_config
|
- setup_circleci_bazel_config
|
||||||
- *setup_bazel_remote_execution
|
- setup_bazel_rbe
|
||||||
|
|
||||||
- run: scripts/build-ivy-npm-packages.sh
|
- run: scripts/build-ivy-npm-packages.sh
|
||||||
|
|
||||||
# Save the npm packages from //packages/... for other workflow jobs to read
|
# Save the npm packages from //packages/... for other workflow jobs to read
|
||||||
- persist_to_workspace:
|
- persist_to_workspace:
|
||||||
root: ~/
|
root: *workspace_location
|
||||||
paths:
|
paths:
|
||||||
- ng/dist/packages-dist-ivy-aot
|
- ng/dist/packages-dist-ivy-aot
|
||||||
|
|
||||||
|
@ -562,8 +568,8 @@ jobs:
|
||||||
resource_class: xlarge
|
resource_class: xlarge
|
||||||
parallelism: 4
|
parallelism: 4
|
||||||
steps:
|
steps:
|
||||||
- *attach_workspace
|
- custom_attach_workspace
|
||||||
- *init_environment
|
- init_environment
|
||||||
# Runs the integration tests in parallel across multiple CircleCI container instances. The
|
# Runs the integration tests in parallel across multiple CircleCI container instances. The
|
||||||
# amount of container nodes for this job is controlled by the "parallelism" option.
|
# amount of container nodes for this job is controlled by the "parallelism" option.
|
||||||
- run: ./integration/run_tests.sh ${CIRCLE_NODE_INDEX} ${CIRCLE_NODE_TOTAL}
|
- run: ./integration/run_tests.sh ${CIRCLE_NODE_INDEX} ${CIRCLE_NODE_TOTAL}
|
||||||
|
@ -585,8 +591,8 @@ jobs:
|
||||||
[[ "$CIRCLE_PROJECT_REPONAME" != "angular" ]]; then
|
[[ "$CIRCLE_PROJECT_REPONAME" != "angular" ]]; then
|
||||||
circleci step halt
|
circleci step halt
|
||||||
fi
|
fi
|
||||||
- *attach_workspace
|
- custom_attach_workspace
|
||||||
- *init_environment
|
- init_environment
|
||||||
# CircleCI has a config setting to force SSH for all github connections
|
# CircleCI has a config setting to force SSH for all github connections
|
||||||
# This is not compatible with our mechanism of using a Personal Access Token
|
# This is not compatible with our mechanism of using a Personal Access Token
|
||||||
# Clear the global setting
|
# Clear the global setting
|
||||||
|
@ -604,8 +610,8 @@ jobs:
|
||||||
# which does not load the browser through the Bazel webtesting rules.
|
# which does not load the browser through the Bazel webtesting rules.
|
||||||
executor: browsers-executor
|
executor: browsers-executor
|
||||||
steps:
|
steps:
|
||||||
- *attach_workspace
|
- custom_attach_workspace
|
||||||
- *init_environment
|
- init_environment
|
||||||
- run: setPublicVar_CI_STABLE_BRANCH
|
- run: setPublicVar_CI_STABLE_BRANCH
|
||||||
- run:
|
- run:
|
||||||
name: Check out `aio/` from the stable branch
|
name: Check out `aio/` from the stable branch
|
||||||
|
@ -615,21 +621,21 @@ jobs:
|
||||||
- run:
|
- run:
|
||||||
name: Run tests against https://angular.io/
|
name: Run tests against https://angular.io/
|
||||||
command: ./aio/scripts/test-production.sh https://angular.io/ $CI_AIO_MIN_PWA_SCORE
|
command: ./aio/scripts/test-production.sh https://angular.io/ $CI_AIO_MIN_PWA_SCORE
|
||||||
- *notify_caretaker_on_fail
|
- notify_caretaker_on_fail
|
||||||
- *notify_dev_infra_on_fail
|
- notify_dev_infra_on_fail
|
||||||
|
|
||||||
aio_monitoring_next:
|
aio_monitoring_next:
|
||||||
# This job needs Chrome to be globally installed because the tests run with Protractor
|
# This job needs Chrome to be globally installed because the tests run with Protractor
|
||||||
# which does not load the browser through the Bazel webtesting rules.
|
# which does not load the browser through the Bazel webtesting rules.
|
||||||
executor: browsers-executor
|
executor: browsers-executor
|
||||||
steps:
|
steps:
|
||||||
- *attach_workspace
|
- custom_attach_workspace
|
||||||
- *init_environment
|
- init_environment
|
||||||
- run:
|
- run:
|
||||||
name: Run tests against https://next.angular.io/
|
name: Run tests against https://next.angular.io/
|
||||||
command: ./aio/scripts/test-production.sh https://next.angular.io/ $CI_AIO_MIN_PWA_SCORE
|
command: ./aio/scripts/test-production.sh https://next.angular.io/ $CI_AIO_MIN_PWA_SCORE
|
||||||
- *notify_caretaker_on_fail
|
- notify_caretaker_on_fail
|
||||||
- *notify_dev_infra_on_fail
|
- notify_dev_infra_on_fail
|
||||||
|
|
||||||
legacy-unit-tests-saucelabs:
|
legacy-unit-tests-saucelabs:
|
||||||
executor:
|
executor:
|
||||||
|
@ -639,8 +645,8 @@ jobs:
|
||||||
# and therefore the tunnel and Karma need to process a lot of file requests and tests.
|
# and therefore the tunnel and Karma need to process a lot of file requests and tests.
|
||||||
resource_class: xlarge
|
resource_class: xlarge
|
||||||
steps:
|
steps:
|
||||||
- *attach_workspace
|
- custom_attach_workspace
|
||||||
- *init_environment
|
- init_environment
|
||||||
- run:
|
- run:
|
||||||
name: Preparing environment for running tests on Saucelabs.
|
name: Preparing environment for running tests on Saucelabs.
|
||||||
command: |
|
command: |
|
||||||
|
@ -661,8 +667,8 @@ jobs:
|
||||||
legacy-misc-tests:
|
legacy-misc-tests:
|
||||||
executor: action-executor
|
executor: action-executor
|
||||||
steps:
|
steps:
|
||||||
- *attach_workspace
|
- custom_attach_workspace
|
||||||
- *init_environment
|
- init_environment
|
||||||
- run: yarn gulp check-cycle
|
- run: yarn gulp check-cycle
|
||||||
# TODO: disabled because the Bazel packages-dist does not seem to have map files for
|
# TODO: disabled because the Bazel packages-dist does not seem to have map files for
|
||||||
# the ESM5/ES2015 output. See: https://github.com/angular/angular/issues/27966
|
# the ESM5/ES2015 output. See: https://github.com/angular/angular/issues/27966
|
||||||
|
@ -675,18 +681,18 @@ jobs:
|
||||||
name: browsers-executor
|
name: browsers-executor
|
||||||
resource_class: xlarge
|
resource_class: xlarge
|
||||||
steps:
|
steps:
|
||||||
- *attach_workspace
|
- custom_attach_workspace
|
||||||
- *init_environment
|
- init_environment
|
||||||
# Although RBE is configured below for the Material repo, also setup RBE in the Angular repo
|
# Although RBE is configured below for the Material repo, also setup RBE in the Angular repo
|
||||||
# to provision Angular's GCP token into the environment variables.
|
# to provision Angular's GCP token into the environment variables.
|
||||||
- *setup_bazel_remote_execution
|
- setup_bazel_rbe
|
||||||
# Restore the cache before cloning the repository because the clone script re-uses
|
# Restore the cache before cloning the repository because the clone script re-uses
|
||||||
# the restored repository if present. This reduces the amount of times the components
|
# the restored repository if present. This reduces the amount of times the components
|
||||||
# repository needs to be cloned (this is slow and increases based on commits in the repo).
|
# repository needs to be cloned (this is slow and increases based on commits in the repo).
|
||||||
- restore_cache:
|
- restore_cache:
|
||||||
keys:
|
keys:
|
||||||
- *material_unit_tests_cache_key
|
- *material_unit_tests_cache_key
|
||||||
- *material_unit_tests_cache_key_short
|
- *material_unit_tests_cache_key_fallback
|
||||||
- run:
|
- run:
|
||||||
name: "Fetching Material repository"
|
name: "Fetching Material repository"
|
||||||
command: ./scripts/ci/clone_angular_material_repo.sh
|
command: ./scripts/ci/clone_angular_material_repo.sh
|
||||||
|
@ -711,8 +717,8 @@ jobs:
|
||||||
test_zonejs:
|
test_zonejs:
|
||||||
executor: action-executor
|
executor: action-executor
|
||||||
steps:
|
steps:
|
||||||
- *attach_workspace
|
- custom_attach_workspace
|
||||||
- *init_environment
|
- init_environment
|
||||||
# Install
|
# Install
|
||||||
- run: yarn --cwd packages/zone.js install --frozen-lockfile --non-interactive
|
- run: yarn --cwd packages/zone.js install --frozen-lockfile --non-interactive
|
||||||
# Run zone.js tools tests
|
# Run zone.js tools tests
|
||||||
|
@ -734,12 +740,12 @@ jobs:
|
||||||
executor: windows-executor
|
executor: windows-executor
|
||||||
steps:
|
steps:
|
||||||
- checkout
|
- checkout
|
||||||
- *init_environment_win
|
- init_environment_win
|
||||||
- *post_checkout_win
|
- *post_checkout_win
|
||||||
# TODO: windows cache restoration is currently failing. Re-enable when it's fixed.
|
# TODO: windows cache restoration is currently failing. Re-enable when it's fixed.
|
||||||
# Example failure: https://circleci.com/gh/angular/angular/423738
|
# Example failure: https://circleci.com/gh/angular/angular/423738
|
||||||
# - *restore_cache_win
|
# - *restore_cache_win
|
||||||
- *setup_circleci_bazel_config_win
|
- setup_circleci_bazel_config_win
|
||||||
- run: yarn install --frozen-lockfile --non-interactive
|
- run: yarn install --frozen-lockfile --non-interactive
|
||||||
# Install @bazel/bazel globally and use that for the first run.
|
# Install @bazel/bazel globally and use that for the first run.
|
||||||
# Workaround for https://github.com/bazelbuild/rules_nodejs/issues/894
|
# Workaround for https://github.com/bazelbuild/rules_nodejs/issues/894
|
||||||
|
@ -760,10 +766,10 @@ jobs:
|
||||||
executor: windows-executor
|
executor: windows-executor
|
||||||
steps:
|
steps:
|
||||||
- checkout
|
- checkout
|
||||||
- *init_environment_win
|
- init_environment_win
|
||||||
- *post_checkout_win
|
- *post_checkout_win
|
||||||
# - *restore_cache_win
|
# - *restore_cache_win
|
||||||
- *setup_circleci_bazel_config_win
|
- setup_circleci_bazel_config_win
|
||||||
- run: yarn install --frozen-lockfile --non-interactive
|
- run: yarn install --frozen-lockfile --non-interactive
|
||||||
- run: yarn global add @bazel/bazel@$env:BAZEL_VERSION
|
- run: yarn global add @bazel/bazel@$env:BAZEL_VERSION
|
||||||
- run: bazel info
|
- run: bazel info
|
||||||
|
@ -878,19 +884,13 @@ workflows:
|
||||||
# This isn't strictly necessary as there is no artifact dependency, but helps economize
|
# 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.
|
# CI resources by not attempting to build when we know should fail.
|
||||||
- test_win:
|
- test_win:
|
||||||
|
<<: *ignore_pull_requests
|
||||||
requires:
|
requires:
|
||||||
- test
|
- test
|
||||||
filters:
|
|
||||||
branches:
|
|
||||||
ignore:
|
|
||||||
- /pull\/.*/
|
|
||||||
- test_ivy_aot_win:
|
- test_ivy_aot_win:
|
||||||
|
<<: *ignore_pull_requests
|
||||||
requires:
|
requires:
|
||||||
- test_ivy_aot
|
- test_ivy_aot
|
||||||
filters:
|
|
||||||
branches:
|
|
||||||
ignore:
|
|
||||||
- /pull\/.*/
|
|
||||||
|
|
||||||
aio_monitoring:
|
aio_monitoring:
|
||||||
jobs:
|
jobs:
|
||||||
|
|
|
@ -26,12 +26,6 @@ Add-Content $profile $bazelVersionGlobalVar
|
||||||
# TODO: is this really needed? Maybe there's a better way. It doesn't happen on Linux or on Codefresh.
|
# TODO: is this really needed? Maybe there's a better way. It doesn't happen on Linux or on Codefresh.
|
||||||
git config --global --unset url.ssh://git@github.com.insteadOf
|
git config --global --unset url.ssh://git@github.com.insteadOf
|
||||||
|
|
||||||
# Print node and yarn versions.
|
|
||||||
echo "Node version:"
|
|
||||||
node -v
|
|
||||||
echo "Yarn version:"
|
|
||||||
yarn -v
|
|
||||||
|
|
||||||
|
|
||||||
# These Bazel prereqs aren't needed because the CircleCI image already includes them.
|
# These Bazel prereqs aren't needed because the CircleCI image already includes them.
|
||||||
# choco install nodejs --version 10.16.0 --no-progress
|
# choco install nodejs --version 10.16.0 --no-progress
|
||||||
|
|
Loading…
Reference in New Issue