forked from flutter/flutter
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add build test for Flutter codelabs (flutter#19579)
* Add build test for Flutter codelabs * Fix indentation in build test script * Correct filename for the codelabs build test run by travis * Change if statement to elif * Replace echo statements with set -x * Add BSD-style license * Add codelabs build test to Cirrus * Remove codelabs_build_test from Travis. * Remove codelabs_build_test from travis_script.sh * Update documentation for codelabs_build_test.sh * Update readme for build test * Add link to open a new issue to MDC-Flutter * Add phrase to address "if you think you really need to break this test, please escalate this"
- Loading branch information
1 parent
4fc5048
commit e2167b9
Showing
3 changed files
with
62 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
#!/bin/bash | ||
# Copyright 2018 The Chromium 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 -ex | ||
|
||
readonly SCRIPTS_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" | ||
readonly ROOT_DIR="$SCRIPTS_DIR/.." | ||
|
||
function is_expected_failure() { | ||
# A test target was specified with the 'build' command. | ||
grep --quiet "is not configured for Running" "$1" | ||
} | ||
|
||
log_file="build_log_for_104_complete.txt" | ||
build_command="flutter build bundle" | ||
|
||
# Attempt to build 104-complete Shrine app from the Flutter codelabs | ||
git clone https://github.com/material-components/material-components-flutter-codelabs.git | ||
cd material-components-flutter-codelabs/mdc_100_series/ | ||
git checkout 104-complete | ||
|
||
all_builds_ok=1 | ||
echo "$build_command" | ||
$build_command 2>&1 | tee "$log_file" | ||
|
||
if [ ${PIPESTATUS[0]} -eq 0 ] || is_expected_failure "$log_file"; then | ||
rm "$log_file" | ||
else | ||
all_builds_ok=0 | ||
echo "View https://github.com/flutter/flutter/blob/master/dev/bots/README.md for steps to resolve this failed build test." >> ${log_file} | ||
echo | ||
echo "Log left in $log_file." | ||
echo | ||
fi | ||
|
||
# If any build failed, exit with a failure exit status so continuous integration | ||
# tools can react appropriately. | ||
if [ "$all_builds_ok" -eq 1 ]; then | ||
exit 0 | ||
else | ||
exit 1 | ||
fi |