Skip to content

build refactoring #81

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

Merged
merged 1 commit into from
Jan 2, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,9 @@ dart:
addons:
chrome: stable

env:
- BOT=main
- BOT=flutter
script: ./tool/travis.sh

branches:
Expand Down
59 changes: 34 additions & 25 deletions tool/travis.sh
Original file line number Diff line number Diff line change
Expand Up @@ -21,31 +21,40 @@ pub global activate tuneup
tuneup check --ignore-infos

# Ensure we can build the app.
pub global activate webdev
webdev build

# Run tests that do not require the Flutter SDK.
pub run test -x useFlutterSdk
pub run test -x useFlutterSdk -pchrome-no-sandbox

# Get Flutter.
curl https://storage.googleapis.com/flutter_infra/releases/stable/macos/flutter_macos_v1.0.0-stable.zip -o ../flutter.zip
cd ..
unzip -qq flutter.zip
export PATH=`pwd`/flutter/bin:`pwd`/flutter/bin/cache/dart-sdk/bin:$PATH
flutter config --no-analytics
flutter doctor

# Should be using dart from ../flutter/bin/cache/dart-sdk/bin/dart
echo "which dart: " `which dart`
pub run webdev build

if [ "$BOT" = "main" ]; then

# Run tests that do not require the Flutter SDK.
pub run test -x useFlutterSdk
pub run test -x useFlutterSdk -pchrome-no-sandbox

elif [ "$BOT" = "flutter" ]; then

# Get Flutter.
git clone https://github.com/flutter/flutter.git ../flutter
cd ..
export PATH=`pwd`/flutter/bin:`pwd`/flutter/bin/cache/dart-sdk/bin:$PATH
flutter config --no-analytics
flutter doctor

# Should be using dart from ../flutter/bin/cache/dart-sdk/bin/dart
echo "which dart: " `which dart`

# Return to the devtools directory
cd devtools

# Run tests that require the Flutter SDK.
pub run test -t useFlutterSdk

# Chrome test passes locally but fails on Travis. See example failure:
# https://travis-ci.org/flutter/devtools/jobs/472755560.
# TODO: investigate if we have a need to run tests requiring the Flutter SDK on Chrome.
# pub run test -t "useFlutterSdk" -pchrome-no-sandbox

# Return to the devtools directory
cd devtools
else

# Run tests that require the Flutter SDK.
pub run test -t useFlutterSdk
echo "unknown bot configuration"
exit 1

# Chrome test passes locally but fails on Travis. See example failure:
# https://travis-ci.org/flutter/devtools/jobs/472755560.
# TODO: investigate if we have a need to run tests requiring the Flutter SDK on Chrome.
# pub run test -t "useFlutterSdk" -pchrome-no-sandbox
fi