Skip to content

Commit

Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[ci] Ensure scripts fail if a command fails (flutter#3963)
Browse files Browse the repository at this point in the history
Cirrus automatically fails as soon as a command fails, but when converting Cirrus steps to LUCI bash scripts we forgot to add `set -e`.

Also adds `pipefail` to the simulator creation script so that part of the pipeline failing will fail the command.

Fixes flutter/flutter#125243
stuartmorgan authored and nploi committed Jul 16, 2023

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
1 parent d68beeb commit a0393fe
Showing 11 changed files with 13 additions and 0 deletions.
1 change: 1 addition & 0 deletions .ci/scripts/build_all_packages_app.sh
Original file line number Diff line number Diff line change
@@ -2,6 +2,7 @@
# Copyright 2013 The Flutter Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
set -e

platform="$1"
build_mode="$2"
1 change: 1 addition & 0 deletions .ci/scripts/build_examples_win32.sh
Original file line number Diff line number Diff line change
@@ -2,6 +2,7 @@
# Copyright 2013 The Flutter Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
set -e

dart ./script/tool/bin/flutter_plugin_tools.dart build-examples --windows \
--packages-for-branch --log-timing
1 change: 1 addition & 0 deletions .ci/scripts/create_all_packages_app.sh
Original file line number Diff line number Diff line change
@@ -2,6 +2,7 @@
# Copyright 2013 The Flutter Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
set -e

dart ./script/tool/bin/flutter_plugin_tools.dart create-all-packages-app \
--output-dir=. --exclude script/configs/exclude_all_packages_app.yaml
3 changes: 3 additions & 0 deletions .ci/scripts/create_simulator.sh
Original file line number Diff line number Diff line change
@@ -2,6 +2,9 @@
# Copyright 2013 The Flutter Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
set -e
# Ensure that the create/boot pipeline fails if `create` fails
set -o pipefail

# The name here must match remove_simulator.sh
readonly DEVICE_NAME=Flutter-iPhone
1 change: 1 addition & 0 deletions .ci/scripts/custom_package_tests.sh
Original file line number Diff line number Diff line change
@@ -2,6 +2,7 @@
# Copyright 2013 The Flutter Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
set -e

# Exclusions
#
1 change: 1 addition & 0 deletions .ci/scripts/dart_unit_tests_win32.sh
Original file line number Diff line number Diff line change
@@ -2,6 +2,7 @@
# Copyright 2013 The Flutter Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
set -e

dart ./script/tool/bin/flutter_plugin_tools.dart test \
--exclude=script/configs/windows_unit_tests_exceptions.yaml \
1 change: 1 addition & 0 deletions .ci/scripts/drive_examples_win32.sh
Original file line number Diff line number Diff line change
@@ -2,6 +2,7 @@
# Copyright 2013 The Flutter Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
set -e

dart ./script/tool/bin/flutter_plugin_tools.dart drive-examples --windows \
--exclude=script/configs/exclude_integration_win32.yaml --packages-for-branch --log-timing
1 change: 1 addition & 0 deletions .ci/scripts/native_test_win32.sh
Original file line number Diff line number Diff line change
@@ -2,6 +2,7 @@
# Copyright 2013 The Flutter Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
set -e

dart ./script/tool/bin/flutter_plugin_tools.dart native-test --windows \
--no-integration --packages-for-branch --log-timing
1 change: 1 addition & 0 deletions .ci/scripts/plugin_tools_tests.sh
Original file line number Diff line number Diff line change
@@ -2,6 +2,7 @@
# Copyright 2013 The Flutter Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
set -e

cd script/tool
dart pub run test
1 change: 1 addition & 0 deletions .ci/scripts/prepare_tool.sh
Original file line number Diff line number Diff line change
@@ -2,6 +2,7 @@
# Copyright 2013 The Flutter Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
set -e

# To set FETCH_HEAD for "git merge-base" to work
git fetch origin main
1 change: 1 addition & 0 deletions .ci/scripts/remove_simulator.sh
Original file line number Diff line number Diff line change
@@ -2,6 +2,7 @@
# Copyright 2013 The Flutter Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
set -e

# The name here must match create_simulator.sh
readonly DEVICE_NAME=Flutter-iPhone

0 comments on commit a0393fe

Please sign in to comment.