forked from mmcc007/modal_progress_hud
-
Notifications
You must be signed in to change notification settings - Fork 12
/
.travis.yml
155 lines (150 loc) · 6.4 KB
/
.travis.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
jobs:
include:
- &unit-test-stage
stage: Unit Testing
language: generic
os: linux
env: channel=stable
before_install: # runs on linux only
- sudo apt-get install -y --no-install-recommends lib32stdc++6 libstdc++6 > /dev/null
before_script:
# install pre-compiled flutter
- FLUTTER_VERSION=1.2.1-${channel}
- |
if [ $TRAVIS_OS_NAME == "osx" ]; then
wget --quiet --output-document=flutter.zip https://storage.googleapis.com/flutter_infra/releases/${channel}/macos/flutter_macos_v${FLUTTER_VERSION}.zip && unzip -qq flutter.zip > /dev/null && rm flutter.zip
else
wget --quiet --output-document=flutter.tar.xz https://storage.googleapis.com/flutter_infra/releases/${channel}/linux/flutter_linux_v${FLUTTER_VERSION}.tar.xz && tar xf flutter.tar.xz > /dev/null && rm flutter.tar.xz
fi
- export PATH="$PATH":"$HOME/.pub-cache/bin"
- export PATH=$PWD/flutter/bin:$PWD/flutter/bin/cache/dart-sdk/bin:$PATH
- flutter doctor -v
- |
[[ $TRAVIS_OS_NAME != "linux" && channel != "stable" ]] || pub global activate coverage
script: ./scripts/runTests.sh
after_success: bash <(curl -s https://codecov.io/bash) -f lcov.info
- <<: *unit-test-stage
os: osx
before_install:
after_success:
env: channel=stable
- <<: *unit-test-stage
env: channel=beta
after_success:
- <<: *unit-test-stage
os: osx
env: channel=beta
before_install:
after_success:
env: channel=beta
- <<: *unit-test-stage
env: channel=dev
after_success:
- <<: *unit-test-stage
os: osx
env: channel=dev
before_install:
after_success:
- <<: *unit-test-stage
env: branch=master
before_script:
- git clone https://github.com/flutter/flutter.git -b $branch
- export PATH="$PATH":"$HOME/.pub-cache/bin"
- export PATH=$PWD/flutter/bin:$PWD/flutter/bin/cache/dart-sdk/bin:$PATH
- flutter precache
- flutter doctor -v
- pub global activate coverage
after_success:
- <<: *unit-test-stage
os: osx
env: branch=master
before_install:
before_script:
- git clone https://github.com/flutter/flutter.git -b $branch
- export PATH="$PATH":"$HOME/.pub-cache/bin"
- export PATH=$PWD/flutter/bin:$PWD/flutter/bin/cache/dart-sdk/bin:$PATH
- flutter precache
- flutter doctor -v
- pub global activate coverage
after_success:
- &integration-test-stage
stage: Integration Testing
sudo: true
dist: trusty
language: generic
os: linux
env: integration-test-linux
# Run integration tests on android
before_install: &before_install_linux
# Install the Android SDK Dependency.
- export ANDROID_HOME=/opt/android-sdk-linux
- cd /opt
- wget -q https://dl.google.com/android/repository/sdk-tools-linux-4333796.zip -O android-sdk-tools.zip
- unzip -q android-sdk-tools.zip -d ${ANDROID_HOME}
- rm android-sdk-tools.zip
- cd -
- PATH=${PATH}:${ANDROID_HOME}/tools:${ANDROID_HOME}/tools/bin:${ANDROID_HOME}/platform-tools
# Silence warning.
- mkdir -p ~/.android
- touch ~/.android/repositories.cfg
# Accept licenses before installing components, no need to echo y for each component
- yes | sdkmanager --licenses
# Platform tools
- sdkmanager "emulator" "tools" "platform-tools" > /dev/null
- sdkmanager --list | head -15
# install older packages (for emulator)
- sdkmanager "build-tools;25.0.2" "platforms;android-25" > /dev/null
# Create and start emulator.
- EMULATOR_API_LEVEL=22
- ANDROID_ABI="default;armeabi-v7a"
- sdkmanager "system-images;android-$EMULATOR_API_LEVEL;$ANDROID_ABI" > /dev/null
- sdkmanager --list | head -15
- echo no | avdmanager create avd --force -n test -k "system-images;android-$EMULATOR_API_LEVEL;$ANDROID_ABI"
- $ANDROID_HOME/emulator/emulator -avd test -no-audio -no-window -gpu swiftshader &
# install pre-compiled flutter
- sudo apt-get install -y --no-install-recommends lib32stdc++6 libstdc++6 > /dev/null
- sdkmanager "platforms;android-28" "build-tools;28.0.3" > /dev/null # required by flutter
- channel=stable
- FLUTTER_VERSION=1.2.1-${channel}
- wget --quiet --output-document=flutter.tar.xz https://storage.googleapis.com/flutter_infra/releases/${channel}/linux/flutter_linux_v${FLUTTER_VERSION}.tar.xz && tar xf flutter.tar.xz > /dev/null && rm flutter.tar.xz
- export PATH="$PATH":"$HOME/.pub-cache/bin"
- export PATH=$PWD/flutter/bin:$PWD/flutter/bin/cache/dart-sdk/bin:$PATH
- flutter doctor -v
# Wait for emulator to finish startup.
- ./scripts/android-wait-for-emulator.sh
- adb shell input keyevent 82
- flutter devices
script: travis_retry ./scripts/ci.sh ./example
- <<: *integration-test-stage
os: osx
# use oldest flutter supported version of xcode
osx_image: xcode8.0
env: integration-test-ios
# Run integration tests on ios
before_install: &before_install_osx
- open /Applications/Xcode.app/Contents/Developer/Applications/Simulator.app
# skip homebrew update
- export HOMEBREW_NO_AUTO_UPDATE=1
# - brew update
- brew install libimobiledevice
- brew install ideviceinstaller
- brew install ios-deploy
- brew install cocoapods || echo 'ignore exit(1)'
- brew link --overwrite cocoapods
# install pre-compiled flutter
- channel=stable
- FLUTTER_VERSION=1.2.1-${channel}
- wget --quiet --output-document=flutter.zip https://storage.googleapis.com/flutter_infra/releases/${channel}/macos/flutter_macos_v${FLUTTER_VERSION}.zip && unzip -qq flutter.zip > /dev/null && rm flutter.zip
- export PATH="$PATH":"$HOME/.pub-cache/bin"
- export PATH=$PWD/flutter/bin:$PWD/flutter/bin/cache/dart-sdk/bin:$PATH
- flutter doctor -v
- flutter devices
script: travis_retry ./scripts/ci.sh ./example
- stage: Ready to deploy
os: osx
language: generic
env: not implemented 🤓
script: echo "Deploying to store ..."
allow_failures:
- env: channel=dev
- env: branch=master