Unverified Commit e60087a1 authored by Greg Spencer's avatar Greg Spencer Committed by GitHub

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.
parent b0046b18
# 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
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))
# <img src="https://flutter.io/images/flutter-mark-square-100.png" alt="Flutter" width="40" height="40" /> 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)
# <img src="https://flutter.io/images/flutter-mark-square-100.png" alt="Flutter" width="40" height="40" /> 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.
......
......@@ -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
......
......@@ -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
......
......@@ -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)
......
......@@ -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
......
......@@ -33,8 +33,8 @@ const Map<String, ShardRunner> _kShards = <String, ShardRunner>{
'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);
......
#!/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
#!/bin/bash
set -ex
export PATH="$PWD/bin:$PWD/bin/cache/dart-sdk/bin:$PATH"
if [ "$SHARD" = "build_and_deploy_gallery" ]; then
version=$(<version)
echo "Building and deploying Flutter Gallery $version"
if [ "$TRAVIS_OS_NAME" = "linux" ]; then
echo "Building Flutter Gallery for Android..."
export ANDROID_HOME=`pwd`/android-sdk
(
cd examples/flutter_gallery
flutter build apk --release -t lib/main_publish.dart
)
echo "Android Flutter Gallery built"
if [[ "$TRAVIS_PULL_REQUEST" == "false" && "$TRAVIS_BRANCH" == "dev" && $version != *"pre"* ]]; then
echo "Deploying to Play Store..."
(
cd examples/flutter_gallery/android
bundle install
bundle exec fastlane deploy_play_store
)
else
echo "Flutter Gallery is only deployed to the Play Store on merged and tagged dev branch commits"
fi
elif [ "$TRAVIS_OS_NAME" = "osx" ]; then
echo "Building Flutter Gallery for iOS..."
(
cd examples/flutter_gallery
flutter build ios --release --no-codesign -t lib/main_publish.dart
)
echo "iOS Flutter Gallery built"
if [[ "$TRAVIS_PULL_REQUEST" == "false" ]]; then
if [[ "$TRAVIS_BRANCH" == "dev" && $version != *"pre"* ]]; then
echo "Archiving with distribution profile and deploying to TestFlight..."
(
cd examples/flutter_gallery/ios
bundle install
bundle exec fastlane build_and_deploy_testflight upload:true
)
else
echo "Archiving with distribution profile..."
(
cd examples/flutter_gallery/ios
bundle install
bundle exec fastlane build_and_deploy_testflight
)
echo "Archive is only deployed to TestFlight on tagged dev branch commits"
fi
else
echo "Flutter Gallery is only deployed to the TestFlight on merged and tagged dev branch commits"
fi
fi
elif [ "$SHARD" = "docs" ]; then
if [ "$TRAVIS_OS_NAME" = "linux" ]; then
# Generate the API docs, upload them
./dev/bots/docs.sh
fi
else
TEST_COMMIT_RANGE="${TRAVIS_COMMIT_RANGE}" dart ./dev/bots/test.dart
fi
#!/bin/bash
set -e
echo $KEY_FILE | base64 --decode > ../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
......@@ -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.
......
......@@ -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.
#
......
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.
......@@ -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.
......
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
......@@ -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';
......
// 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';
......@@ -32,6 +32,9 @@ class BotDetector {
// https://www.appveyor.com/docs/environment-variables/
|| platform.environment.containsKey('APPVEYOR')
// 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'))
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment