Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ci: introduce configuration to fail fast for CI failures #21315

Merged
merged 2 commits into from Jul 14, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
19 changes: 16 additions & 3 deletions .circleci/config.yml
Expand Up @@ -68,6 +68,14 @@ executors:
# Command Definitions
# https://circleci.com/docs/2.0/reusing-config/#authoring-reusable-commands
commands:
fail_fast:
steps:
- run:
name: 'Cancel workflow on fail'
when: on_fail
command: |
curl -X POST --header "Content-Type: application/json" "https://circleci.com/api/v2/workflow/${CIRCLE_WORKFLOW_ID}/cancel?circle-token=${CIRCLE_TOKEN}"

custom_attach_workspace:
description: Attach workspace at a predefined location
steps:
Expand Down Expand Up @@ -207,6 +215,7 @@ jobs:
command: |
mkdir /mnt/ramdisk/e2e-yarn
node ./tests/legacy-cli/run_e2e --nb-shards=${CIRCLE_NODE_TOTAL} --shard=${CIRCLE_NODE_INDEX} <<# parameters.snapshots >>--ng-snapshots<</ parameters.snapshots >> --yarn --tmpdir=/mnt/ramdisk/e2e-yarn --glob="{tests/basic/**,tests/update/**,tests/commands/add/**}"
- fail_fast

test-browsers:
executor:
Expand All @@ -232,6 +241,7 @@ jobs:
- run: node ./tests/legacy-cli/run_e2e ./tests/legacy-cli/e2e/tests/misc/browsers.ts --ve
- run: node ./tests/legacy-cli/run_e2e ./tests/legacy-cli/e2e/tests/misc/browsers.ts
- run: ./scripts/saucelabs/stop-tunnel.sh
- fail_fast

build:
executor: action-executor
Expand All @@ -250,6 +260,7 @@ jobs:
- run:
command: yarn bazel:test
no_output_timeout: 20m
- fail_fast

snapshot_publish:
executor: action-executor
Expand All @@ -267,6 +278,7 @@ jobs:
name: Deployment to Snapshot
command: |
yarn admin snapshots --verbose --githubTokenFile=${HOME}/github_token
- fail_fast

# Windows jobs
e2e-cli-win:
Expand All @@ -292,6 +304,7 @@ jobs:
} else {
node tests\legacy-cli\run_e2e.js --nb-shards=$env:CIRCLE_NODE_TOTAL --shard=$env:CIRCLE_NODE_INDEX
}
- fail_fast

workflows:
version: 2
Expand Down Expand Up @@ -320,7 +333,7 @@ workflows:
name: e2e-cli-ng-snapshots
snapshots: true
requires:
- e2e-cli
- build
filters:
branches:
only:
Expand All @@ -331,7 +344,7 @@ workflows:
nodeversion: '12.20'
<<: *only_release_branches
requires:
- e2e-cli
- build
- test-browsers:
requires:
- build
Expand All @@ -347,7 +360,7 @@ workflows:
# Windows jobs
- e2e-cli-win:
requires:
- test
- build

# Publish jobs
- snapshot_publish:
Expand Down