build: group sharded "test_docs_examples" jobs within circleci (#27937)

* Groups the two sharded `test_docs_examples` job using CircleCI's `parallelism` feature.  This makes the amount of jobs that show up on a PR, more reduced and also reduces code duplication for maintaining the Circle job definition.

PR Close #27937
This commit is contained in:
Paul Gschwendtner 2019-01-06 15:37:55 +01:00 committed by Kara Erickson
parent b47c43af45
commit 8e530a03b6
1 changed files with 8 additions and 29 deletions

View File

@ -218,11 +218,12 @@ jobs:
- run: yarn --cwd aio tools-test - run: yarn --cwd aio tools-test
- run: ./aio/aio-builds-setup/scripts/test.sh - run: ./aio/aio-builds-setup/scripts/test.sh
test_docs_examples_0: test_docs_examples:
<<: *job_defaults <<: *job_defaults
docker: docker:
# Needed because the example e2e tests depend on Chrome. # Needed because the example e2e tests depend on Chrome.
- image: *browsers_docker_image - image: *browsers_docker_image
parallelism: 2
steps: steps:
- checkout: - checkout:
<<: *post_checkout <<: *post_checkout
@ -235,28 +236,10 @@ jobs:
- *yarn_install - *yarn_install
# 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 # Run examples tests. The "CIRCLE_NODE_INDEX" will be set if "parallelism" is enabled.
- run: yarn --cwd aio example-e2e --setup --local --shard=0/2 # Since the parallelism is set to "2", there will be two parallel CircleCI containers
# with either "0" or "1" as node index. This can be passed to the "--shard" argument.
test_docs_examples_1: - run: yarn --cwd aio example-e2e --setup --local --shard=${CIRCLE_NODE_INDEX}/${CIRCLE_NODE_TOTAL}
<<: *job_defaults
docker:
# Needed because the example e2e tests depend on Chrome.
- image: *browsers_docker_image
steps:
- checkout:
<<: *post_checkout
- restore_cache:
key: *cache_key
- attach_workspace:
at: dist
- *define_env_vars
# Install root
- *yarn_install
# Install aio
- run: yarn --cwd aio install --frozen-lockfile --non-interactive
# Run examples tests
- run: yarn --cwd aio example-e2e --setup --local --shard=1/2
# This job should only be run on PR builds, where `CI_PULL_REQUEST` is not `false`. # This job should only be run on PR builds, where `CI_PULL_REQUEST` is not `false`.
aio_preview: aio_preview:
@ -517,10 +500,7 @@ workflows:
- test_aio_tools: - test_aio_tools:
requires: requires:
- build-packages-dist - build-packages-dist
- test_docs_examples_0: - test_docs_examples:
requires:
- build-packages-dist
- test_docs_examples_1:
requires: requires:
- build-packages-dist - build-packages-dist
- aio_preview: - aio_preview:
@ -546,8 +526,7 @@ workflows:
- integration_test - integration_test
# Only publish if `aio`/`docs` tests using the locally built Angular packages pass # Only publish if `aio`/`docs` tests using the locally built Angular packages pass
- test_aio_local - test_aio_local
- test_docs_examples_0 - test_docs_examples
- test_docs_examples_1
# Get the artifacts to publish from the build-packages-dist job # Get the artifacts to publish from the build-packages-dist job
# since the publishing script expects the legacy outputs layout. # since the publishing script expects the legacy outputs layout.
- build-packages-dist - build-packages-dist