From e60087a1a783d040097aa4daabdcba9c08c74575 Mon Sep 17 00:00:00 2001 From: Greg Spencer Date: Tue, 7 Aug 2018 13:41:33 -0700 Subject: [PATCH] Remove Travis configuration from flutter/flutter (#20288) This removes the final traces of Travis and Appveyor from the Flutter tree. I've updated the documentation and fixed a couple of places where scripts look for Travis, and eliminated the dart tools runningOnTravis function (which was unused anyhow). There are places in the flutter script that used to look for the environment variable TRAVIS. We actually do want to continue to detect that we're running on Travis there, since in the plugins repo we still use Travis (for the moment). In any case, it's OK, because the CI environment variable is set on all of the CI bots (Cirrus, Travis, and Appveyor). FastLane doesn't have a setup_cirrus equivalent to setup_travis, but it actually doesn't matter there either, since it doesn't do Travis-specific things, and it also looks for the CI environment variable. --- .travis.yml | 49 --------------- CONTRIBUTING.md | 9 ++- README.md | 4 +- bin/flutter | 18 +++--- bin/flutter.bat | 6 +- dev/bots/README.md | 16 +++-- dev/bots/docs.sh | 2 +- dev/bots/test.dart | 4 +- dev/bots/travis_install.sh | 25 -------- dev/bots/travis_script.sh | 63 ------------------- dev/bots/travis_setup.sh | 63 ------------------- dev/devicelab/README.md | 6 +- dev/devicelab/manifest.yaml | 2 +- .../android/fastlane/README.md | 6 +- .../flutter_gallery/ios/fastlane/Fastfile | 5 +- .../flutter_gallery/ios/fastlane/README.md | 6 +- packages/flutter_test/lib/flutter_test.dart | 1 - packages/flutter_test/lib/src/platform.dart | 8 --- .../flutter_tools/lib/src/base/utils.dart | 13 ++-- 19 files changed, 55 insertions(+), 251 deletions(-) delete mode 100644 .travis.yml delete mode 100755 dev/bots/travis_install.sh delete mode 100755 dev/bots/travis_script.sh delete mode 100755 dev/bots/travis_setup.sh delete mode 100644 packages/flutter_test/lib/src/platform.dart diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index 54bff38803..0000000000 --- a/.travis.yml +++ /dev/null @@ -1,49 +0,0 @@ -# ENVIRONMENTS -os: - - linux - - osx -osx_image: xcode9.2 -env: - - SHARD=analyze - - SHARD=tests - - SHARD=tool_tests - - SHARD=docs - - SHARD=build_and_deploy_gallery -matrix: - exclude: - - os: osx - env: SHARD=analyze - - os: osx - env: SHARD=docs -sudo: false -filter_secrets: false - -# INSTALLATION -addons: - apt: - # sky_shell binary depends on /usr/lib/x86_64-linux-gnu/libstdc++.so.6 version GLIBCXX_3.4.18 - sources: - - ubuntu-toolchain-r-test # if we don't specify this, the libstdc++6 we get is the wrong version - packages: - - lib32stdc++6 - - libstdc++6 - - fonts-droid -language: node_js -node_js: - - "8.1" -git: - # We rely on git tags for determining the version. - depth: false -cache: - bundler: true - directories: - - $HOME/.pub-cache -install: - - ./dev/bots/travis_install.sh - -# TESTING -before_script: - - ./dev/bots/travis_setup.sh -script: - - ulimit -S -n 2048 # https://github.com/flutter/flutter/issues/2976 - - ./dev/bots/travis_script.sh diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 43fca9b7e8..9404ad74e5 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -1,7 +1,7 @@ Contributing to Flutter ======================= -[![Build Status](https://travis-ci.org/flutter/flutter.svg)](https://travis-ci.org/flutter/flutter) +[![Build Status](https://api.cirrus-ci.com/github/flutter/flutter.svg)](https://cirrus-ci.org/flutter/flutter) _See also: [Flutter's code of conduct](https://flutter.io/design-principles/#code-of-conduct)_ @@ -129,7 +129,7 @@ which provides flutter-specific extensions on top of [package:test](https://pub. option to start the test in a paused state and wait for connection from a debugger. This option lets you set breakpoints before the test runs. -To run all the tests for the entire Flutter repository, the same way that Travis runs them, run `dart dev/bots/test.dart`. +To run all the tests for the entire Flutter repository, the same way that Cirrus runs them, run `dart dev/bots/test.dart`. If you've built [your own flutter engine](#working-on-the-engine-and-the-framework-at-the-same-time), you can pass `--local-engine` to change what flutter shell `flutter test` uses. For example, @@ -190,7 +190,7 @@ To send us a pull request: Please make sure all your checkins have detailed commit messages explaining the patch. Once you've gotten an LGTM from a project maintainer and once your PR has received -the green light from all our automated testing (Travis, Appveyor, etc), and once +the green light from all our automated testing (running on Cirrus, etc), and once the tree is green (see the [design principles](https://flutter.io/design-principles/) document for more details), submit your changes to the `master` branch using one of the following methods: @@ -285,7 +285,6 @@ Build infrastructure We build and test Flutter on: -- Travis ([details](.travis.yml)) -- AppVeyor ([details](appveyor.yml)) +- [Cirrus](https://cirrus-ci.com/) ([details](.cirrus.yml)) - Chromebots (a.k.a. "recipes", [details](dev/bots/README.md)) - Devicelab (a.k.a. "cocoon", [details](dev/devicelab/README.md)) diff --git a/README.md b/README.md index 67b7fd9048..d20e09618d 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,6 @@ -# Flutter Flutter [![Join Gitter Chat Channel -](https://badges.gitter.im/flutter/flutter.svg)](https://gitter.im/flutter/flutter?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge) [![Build Status - Travis](https://travis-ci.org/flutter/flutter.svg?branch=master)](https://travis-ci.org/flutter/flutter) [![Build Status - AppVeyor](https://ci.appveyor.com/api/projects/status/meyi9evcny64a2mg/branch/master?svg=true)](https://ci.appveyor.com/project/flutter/flutter/branch/master) [![Build Status - Cirrus](https://api.cirrus-ci.com/github/flutter/flutter.svg)](https://cirrus-ci.com/github/flutter/flutter) [![Coverage Status -](https://coveralls.io/repos/github/flutter/flutter/badge.svg?branch=master)](https://coveralls.io/github/flutter/flutter?branch=master) +# Flutter Flutter [![Join Gitter Chat Channel -](https://badges.gitter.im/flutter/flutter.svg)](https://gitter.im/flutter/flutter?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge) +[![Build Status - Cirrus](https://api.cirrus-ci.com/github/flutter/flutter.svg)](https://cirrus-ci.com/github/flutter/flutter) +[![Coverage Status -](https://coveralls.io/repos/github/flutter/flutter/badge.svg?branch=master)](https://coveralls.io/github/flutter/flutter?branch=master) A new mobile app SDK to help developers and designers build modern mobile apps for iOS and Android. Flutter is an open-source project currently in beta. diff --git a/bin/flutter b/bin/flutter index 7aecf5c14d..f5c4da1392 100755 --- a/bin/flutter +++ b/bin/flutter @@ -85,16 +85,16 @@ function upgrade_flutter () { fi local revision="$(cd "$FLUTTER_ROOT"; git rev-parse HEAD)" - if [[ ! -f "$SNAPSHOT_PATH" ]] || [[ ! -s "$STAMP_PATH" ]] || [[ "$(cat "$STAMP_PATH")" != "$revision" ]] || [[ "$FLUTTER_TOOLS_DIR/pubspec.yaml" -nt "$FLUTTER_TOOLS_DIR/pubspec.lock" ]]; then + if [[ ! -f "$SNAPSHOT_PATH" || ! -s "$STAMP_PATH" || "$(cat "$STAMP_PATH")" != "$revision" || "$FLUTTER_TOOLS_DIR/pubspec.yaml" -nt "$FLUTTER_TOOLS_DIR/pubspec.lock" ]]; then rm -f "$FLUTTER_ROOT/version" touch "$FLUTTER_ROOT/bin/cache/.dartignore" "$FLUTTER_ROOT/bin/internal/update_dart_sdk.sh" - VERBOSITY=--verbosity=error + VERBOSITY="--verbosity=error" echo Building flutter tool... - if [[ "$TRAVIS" == "true" ]] || [[ "$BOT" == "true" ]] || [[ "$CONTINUOUS_INTEGRATION" == "true" ]] || [[ "$CHROME_HEADLESS" == "1" ]] || [[ "$APPVEYOR" == "true" ]] || [[ "$CI" == "true" ]]; then + if [[ "$CI" == "true" || "$BOT" == "true" || "$CONTINUOUS_INTEGRATION" == "true" || "$CHROME_HEADLESS" == "1" ]]; then PUB_ENVIRONMENT="$PUB_ENVIRONMENT:flutter_bot" - VERBOSITY=--verbosity=all + VERBOSITY="--verbosity=all" fi export PUB_ENVIRONMENT="$PUB_ENVIRONMENT:flutter_install" @@ -104,8 +104,8 @@ function upgrade_flutter () { while : ; do cd "$FLUTTER_TOOLS_DIR" - "$PUB" upgrade $VERBOSITY --no-packages-dir && break - echo Error: Unable to 'pub upgrade' flutter tool. Retrying in five seconds... + "$PUB" upgrade "$VERBOSITY" --no-packages-dir && break + echo "Error: Unable to 'pub upgrade' flutter tool. Retrying in five seconds..." sleep 5 done "$DART" --snapshot="$SNAPSHOT_PATH" --packages="$FLUTTER_TOOLS_DIR/.packages" "$SCRIPT_PATH" @@ -132,7 +132,7 @@ DART="$DART_SDK_PATH/bin/dart" PUB="$DART_SDK_PATH/bin/pub" # Test if running as superuser – but don't warn if running within Docker -if [[ "$EUID" == "0" ]] && ! [[ -f /.dockerenv ]]; then +if [[ "$EUID" == "0" && ! -f /.dockerenv ]]; then echo " Woah! You appear to be trying to run flutter as root." echo " We strongly recommend running the flutter tool without superuser privileges." echo " /" @@ -160,12 +160,14 @@ fi (upgrade_flutter) 3< "$PROG_NAME" set +e +# FLUTTER_TOOL_ARGS isn't quoted below, because it is meant to be considered as +# separate space-separated args. "$DART" $FLUTTER_TOOL_ARGS "$SNAPSHOT_PATH" "$@" # The VM exits with code 253 if the snapshot version is out-of-date. # If it is, we need to snapshot it again. EXIT_CODE=$? -if [[ $EXIT_CODE -ne 253 ]]; then +if [[ $EXIT_CODE != 253 ]]; then exit $EXIT_CODE fi diff --git a/bin/flutter.bat b/bin/flutter.bat index 4764703b9e..fd458cfba7 100644 --- a/bin/flutter.bat +++ b/bin/flutter.bat @@ -119,12 +119,10 @@ GOTO :after_subroutine REM Makes changes to PUB_ENVIRONMENT only visible to commands within SETLOCAL/ENDLOCAL SETLOCAL SET VERBOSITY=--verbosity=error - IF "%TRAVIS%" == "true" GOTO on_bot + IF "%CI%" == "true" GOTO on_bot IF "%BOT%" == "true" GOTO on_bot IF "%CONTINUOUS_INTEGRATION%" == "true" GOTO on_bot IF "%CHROME_HEADLESS%" == "1" GOTO on_bot - IF "%APPVEYOR%" == "true" GOTO on_bot - IF "%CI%" == "true" GOTO on_bot GOTO not_on_bot :on_bot SET PUB_ENVIRONMENT=%PUB_ENVIRONMENT%:flutter_bot @@ -135,7 +133,7 @@ GOTO :after_subroutine IF EXIST "%pub_cache_path%" SET PUB_CACHE=%pub_cache_path% ) :retry_pub_upgrade - CALL "%pub%" upgrade %VERBOSITY% --no-packages-dir + CALL "%pub%" upgrade "%VERBOSITY%" --no-packages-dir IF "%ERRORLEVEL%" NEQ "0" ( ECHO Error: Unable to 'pub upgrade' flutter tool. Retrying in five seconds... timeout /t 5 /nobreak diff --git a/dev/bots/README.md b/dev/bots/README.md index 9ecef48ab9..a340fd1a34 100644 --- a/dev/bots/README.md +++ b/dev/bots/README.md @@ -3,16 +3,22 @@ This directory exists to support building Flutter on our build infrastructure. The results of such builds are viewable at: +* https://cirrus-ci.com/github/flutter/flutter/master + - Testing done on PRs and submitted changes on GitHub. * https://build.chromium.org/p/client.flutter/console -* https://travis-ci.org/flutter/flutter/builds (limited checking used just for PRs on github) + - Additional testing and processing done after changes are submitted. -The external master pages for the chromium infra bots do not allow +The external master pages for the Chromium infra bots do not allow forcing new builds. Contact @eseidelGoogle or another member of Google's Flutter team if you need to do that. -The Travis-based bots are trivial, and just run a couple of shell -scripts. The rest of this document discusses only the chromium infra -bots. +The [Cirrus](https://cirrus-ci.org)-based bots run the [`test.dart`](test.dart) +script for each PR and submission. It does testing for the tools, for the +framework, and (for submitted changes only) rebuilds and updates the master +branch API docs staging site. For tagged dev and beta builds, it also builds and +deploys the gallery app to the app stores. + +The rest of this document discusses only the Chromium infra bots. This infrastructure is broken into two parts. A buildbot master specified by our [builders.pyl](https://chromium.googlesource.com/chromium/tools/build.git/+/master/masters/master.client.flutter/builders.pyl) diff --git a/dev/bots/docs.sh b/dev/bots/docs.sh index 8bae3cacab..6b68da8c42 100755 --- a/dev/bots/docs.sh +++ b/dev/bots/docs.sh @@ -75,7 +75,7 @@ fi # Ensure google webmaster tools can verify our site. cp "$FLUTTER_ROOT/dev/docs/google2ed1af765c529f57.html" "$FLUTTER_ROOT/dev/docs/doc" -# Upload new API docs when on Travis +# Upload new API docs when running on Cirrus if [[ -n "$CIRRUS_CI" && -z "$CIRRUS_PR" ]]; then echo "This is not a pull request; considering whether to upload docs... (branch=$CIRRUS_BRANCH)" if [[ "$CIRRUS_BRANCH" == "master" || "$CIRRUS_BRANCH" == "beta" ]]; then diff --git a/dev/bots/test.dart b/dev/bots/test.dart index b9c4d506d9..b29bebaf1c 100644 --- a/dev/bots/test.dart +++ b/dev/bots/test.dart @@ -33,8 +33,8 @@ const Map _kShards = { 'tests': _runTests, 'tool_tests': _runToolTests, 'coverage': _runCoverage, - // 'docs': handled by travis_script.sh and docs.sh - // 'build_and_deploy_gallery': handled by travis_script.sh + // 'docs': handled by docs.sh + // 'build_and_deploy_gallery': handled by deploy_gallery.sh }; const Duration _kLongTimeout = Duration(minutes: 45); diff --git a/dev/bots/travis_install.sh b/dev/bots/travis_install.sh deleted file mode 100755 index bbe52f8514..0000000000 --- a/dev/bots/travis_install.sh +++ /dev/null @@ -1,25 +0,0 @@ -#!/bin/bash -set -ex - -function retry { - local total_tries=$1 - local remaining_tries=$total_tries - shift - while [ $remaining_tries -gt 0 ]; do - "$@" && break - remaining_tries=$(($remaining_tries - 1)) - sleep 5 - done - - [ $remaining_tries -eq 0 ] && { - echo "Command still failed after $total_tries tries: $@" - return 1 - } - return 0 -} - -if [ -n "$TRAVIS" ] && [ "$TRAVIS_PULL_REQUEST" == "false" ]; then - gem install coveralls-lcov - gem install bundler - retry 5 npm install -g firebase-tools@">=3.6.1 <3.7.0" -fi diff --git a/dev/bots/travis_script.sh b/dev/bots/travis_script.sh deleted file mode 100755 index f85bc3eefc..0000000000 --- a/dev/bots/travis_script.sh +++ /dev/null @@ -1,63 +0,0 @@ -#!/bin/bash - -set -ex - -export PATH="$PWD/bin:$PWD/bin/cache/dart-sdk/bin:$PATH" - -if [ "$SHARD" = "build_and_deploy_gallery" ]; then - version=$( ../gcloud_key_file.json - -set -x - -if [ -n "$TRAVIS" ]; then - # Only used to upload docs. Don't install gcloud SDK otherwise. - if [ "$TRAVIS_OS_NAME" = "linux" ] && [ "$SHARD" = "docs" ]; then - export CLOUDSDK_CORE_DISABLE_PROMPTS=1 - echo "Installing Google Cloud SDK..." - curl https://sdk.cloud.google.com | bash > /dev/null - echo "Google Cloud SDK installation completed." - fi - - # Android SDK only needed to build the gallery on build_and_deploy_gallery Linux shard. - if [ "$TRAVIS_OS_NAME" = "linux" ] && [ "$SHARD" = "build_and_deploy_gallery" ]; then - # Background for not using Travis's built-in Android tags - # https://github.com/flutter/plugins/pull/145 - # Copied from https://github.com/flutter/plugins/blame/master/.travis.yml - wget https://dl.google.com/android/repository/sdk-tools-linux-3859397.zip - mkdir android-sdk - unzip -qq sdk-tools-linux-3859397.zip -d android-sdk - export ANDROID_HOME=`pwd`/android-sdk - export PATH=`pwd`/android-sdk/tools/bin:$PATH - mkdir -p /home/travis/.android # silence sdkmanager warning - set +x # Travis's env variable hiding is a bit wonky. Don't echo back this line. - if [ -n "$ANDROID_GALLERY_UPLOAD_KEY" ]; then - echo "$ANDROID_GALLERY_UPLOAD_KEY" | base64 --decode > /home/travis/.android/debug.keystore - fi - set -x - echo 'count=0' > /home/travis/.android/repositories.cfg # silence sdkmanager warning - # suppressing output of sdkmanager to keep log under 4MB (travis limit) - echo y | sdkmanager "tools" >/dev/null - echo y | sdkmanager "platform-tools" >/dev/null - echo y | sdkmanager "build-tools;27.0.3" >/dev/null - echo y | sdkmanager "platforms;android-27" >/dev/null - echo y | sdkmanager "extras;android;m2repository" >/dev/null - echo y | sdkmanager "extras;google;m2repository" >/dev/null - echo y | sdkmanager "patcher;v4" >/dev/null - sdkmanager --list - wget http://services.gradle.org/distributions/gradle-4.4-bin.zip - unzip -qq gradle-4.4-bin.zip - export GRADLE_HOME=$PWD/gradle-4.4 - export PATH=$GRADLE_HOME/bin:$PATH - gradle -v - ./bin/flutter doctor - fi -fi - -# rename the SDK directory to include a space -echo "Renaming Flutter checkout directory to 'flutter sdk'" -cd .. -mv flutter flutter\ sdk -cd flutter\ sdk -echo "SDK directory is: $PWD" - -# disable analytics on the bots and download Flutter dependencies -./bin/flutter config --no-analytics - -# run pub get in all the repo packages -./bin/flutter update-packages diff --git a/dev/devicelab/README.md b/dev/devicelab/README.md index 4450ee06a8..2a0eba6281 100644 --- a/dev/devicelab/README.md +++ b/dev/devicelab/README.md @@ -64,7 +64,7 @@ Legend: ![Task status legend](images/legend.png) The example below shows that commit `e122d5d` caused a wide-spread breakage, -which was fixed by `bdc6f10`. It also shows that Travis, AppVeyor and Chrome +which was fixed by `bdc6f10`. It also shows that Cirrus and Chrome Infra (left-most tasks) decided to skip building these commits. Hovering over a cell will pop up a tooltip containing the name of the broken task. Clicking on the cell will open the log file in a new browser tab (only visible to core @@ -75,9 +75,9 @@ contributors as of today). ## Why is a task stuck on "new task" status? The dashboard aggregates build results from multiple build environments, -including Travis, AppVeyor, Chrome Infra, and devicelab. While devicelab +including Cirrus, Chrome Infra, and devicelab. While devicelab tests every commit that goes into the `master` branch, other environments -may skip some commits. For example, Travis and AppVeyor will only test the +may skip some commits. For example, Cirrus will only test the _last_ commit of a PR that's merged into the `master` branch. Chrome Infra may skip commits when they come in too fast. diff --git a/dev/devicelab/manifest.yaml b/dev/devicelab/manifest.yaml index 5621cdbf1f..78388f970d 100644 --- a/dev/devicelab/manifest.yaml +++ b/dev/devicelab/manifest.yaml @@ -17,7 +17,7 @@ # * stage: one of "devicelab", "devicelab_ios", "devicelab_win" # tasks are grouped by stage so they appear next to each on the dashboard and have a distinct # icon attached to them. Stages can be used to create dependencies, e.g. we may decide to not -# run device tests on red Travis. +# run device tests on red Cirrus builds. # * required_agent_capabilities: a list of strings # list of capabilities a devicelab agent must have to be able to run this task. # diff --git a/examples/flutter_gallery/android/fastlane/README.md b/examples/flutter_gallery/android/fastlane/README.md index 2c91f153f2..6030165b36 100644 --- a/examples/flutter_gallery/android/fastlane/README.md +++ b/examples/flutter_gallery/android/fastlane/README.md @@ -1,10 +1,10 @@ -fastlane documentation +FastLane documentation ================ This folder contains hermetic scripts to deploy a built APK to the play store. -This is done using the [fastlane](https://fastlane.tools) tool suite. +This is done using the [FastLane](https://fastlane.tools) tool suite. Deployment can be done manually by Googlers by following go/flutter-gallery-publish (internal doc). -Deployment is automatically done by Travis on branch cuts. +Deployment is automatically done by Cirrus on tagged branch commits. diff --git a/examples/flutter_gallery/ios/fastlane/Fastfile b/examples/flutter_gallery/ios/fastlane/Fastfile index 957711cca4..5ab932fd95 100644 --- a/examples/flutter_gallery/ios/fastlane/Fastfile +++ b/examples/flutter_gallery/ios/fastlane/Fastfile @@ -22,7 +22,10 @@ end platform :ios do desc 'Push a new release to TestFlight' lane :build_and_deploy_testflight do |options| - # Doesn't do anything when not on Travis. + # Doesn't do anything when not on a CI bot. Even though it's called + # "setup_travis", this also runs on Cirrus, since the CI environment + # variable is set. When on a CI bot, it creates a temporary keychain and + # switches "match" to readonly mode to not create new profiles/certs on CI. setup_travis # Relative to this file. diff --git a/examples/flutter_gallery/ios/fastlane/README.md b/examples/flutter_gallery/ios/fastlane/README.md index b923a9b9d6..410b0b4fbf 100644 --- a/examples/flutter_gallery/ios/fastlane/README.md +++ b/examples/flutter_gallery/ios/fastlane/README.md @@ -1,11 +1,11 @@ -fastlane documentation +FastLane documentation ================ This folder contains hermetic scripts to re-build the app using a distribution profile and then deploy to TestFlight. -This is done using the [fastlane](https://fastlane.tools) tool suite. +This is done using the [FastLane](https://fastlane.tools) tool suite. Deployment can be done manually by Googlers by following go/flutter-gallery-publish (internal doc). -Deployment is automatically done by Travis on branch cuts. \ No newline at end of file +Deployment is automatically done by Cirrus on tagged branch commits. \ No newline at end of file diff --git a/packages/flutter_test/lib/flutter_test.dart b/packages/flutter_test/lib/flutter_test.dart index c46e733bb9..8f8cc8e5b2 100644 --- a/packages/flutter_test/lib/flutter_test.dart +++ b/packages/flutter_test/lib/flutter_test.dart @@ -53,7 +53,6 @@ export 'src/finders.dart'; export 'src/goldens.dart'; export 'src/matchers.dart'; export 'src/nonconst.dart'; -export 'src/platform.dart'; export 'src/stack_manipulation.dart'; export 'src/test_async_utils.dart'; export 'src/test_exception_reporter.dart'; diff --git a/packages/flutter_test/lib/src/platform.dart b/packages/flutter_test/lib/src/platform.dart deleted file mode 100644 index e6b52ec2c7..0000000000 --- a/packages/flutter_test/lib/src/platform.dart +++ /dev/null @@ -1,8 +0,0 @@ -// 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. - -import 'dart:io'; - -/// Whether the test is running in a Travis CI environment. -bool get runningOnTravis => Platform.environment['TRAVIS'] == 'true'; diff --git a/packages/flutter_tools/lib/src/base/utils.dart b/packages/flutter_tools/lib/src/base/utils.dart index 44e9c620e8..e8a609aa9a 100644 --- a/packages/flutter_tools/lib/src/base/utils.dart +++ b/packages/flutter_tools/lib/src/base/utils.dart @@ -24,21 +24,24 @@ class BotDetector { return platform.environment['BOT'] != 'false' && (platform.environment['BOT'] == 'true' - // https://docs.travis-ci.com/user/environment-variables/#Default-Environment-Variables + // https://docs.travis-ci.com/user/environment-variables/#Default-Environment-Variables || platform.environment['TRAVIS'] == 'true' || platform.environment['CONTINUOUS_INTEGRATION'] == 'true' || platform.environment.containsKey('CI') // Travis and AppVeyor - // https://www.appveyor.com/docs/environment-variables/ + // https://www.appveyor.com/docs/environment-variables/ || platform.environment.containsKey('APPVEYOR') - // https://docs.aws.amazon.com/codebuild/latest/userguide/build-env-ref-env-vars.html + // https://cirrus-ci.org/guide/writing-tasks/#environment-variables + || platform.environment.containsKey('CIRRUS_CI') + + // https://docs.aws.amazon.com/codebuild/latest/userguide/build-env-ref-env-vars.html || (platform.environment.containsKey('AWS_REGION') && platform.environment.containsKey('CODEBUILD_INITIATOR')) - // https://wiki.jenkins.io/display/JENKINS/Building+a+software+project#Buildingasoftwareproject-belowJenkinsSetEnvironmentVariables + // https://wiki.jenkins.io/display/JENKINS/Building+a+software+project#Buildingasoftwareproject-belowJenkinsSetEnvironmentVariables || platform.environment.containsKey('JENKINS_URL') - // Properties on Flutter's Chrome Infra bots. + // Properties on Flutter's Chrome Infra bots. || platform.environment['CHROME_HEADLESS'] == '1' || platform.environment.containsKey('BUILDBOT_BUILDERNAME')); }