forked from brianegan/flutter_architecture_samples
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.travis.yml
238 lines (225 loc) · 9.04 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
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
jobs:
include:
- stage: Unit Testing
language: generic
os: linux
env: All unit and widget tests
before_script:
- sudo apt-get install -y --no-install-recommends lib32stdc++6 libstdc++6 > /dev/null
# - git clone https://github.com/flutter/flutter.git -b stable
# - flutter precache
# install pre-compiled flutter
- FLUTTER_CHANNEL=stable
- FLUTTER_VERSION=1.0.0-${FLUTTER_CHANNEL}
- wget --quiet --output-document=flutter.tar.xz https://storage.googleapis.com/flutter_infra/releases/${FLUTTER_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
- pub global activate coverage
script: ./scripts/runTests.sh
after_success: bash <(curl -s https://codecov.io/bash) -f lcov.info
cache:
directories:
- $HOME/.pub-cache
- &integration-test-staging
stage: Integration Testing
sudo: true
dist: trusty
language: generic
os: linux
env: bloc_flutter_android
# Run integration tests on android
before_install: &before_install_linux
- sudo apt-get install -y --no-install-recommends lib32stdc++6 libstdc++6 > /dev/null
# 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 &
# - git clone https://github.com/flutter/flutter.git -b stable
# - flutter precache
# install pre-compiled flutter
- FLUTTER_CHANNEL=stable
- FLUTTER_VERSION=1.0.0-${FLUTTER_CHANNEL}
- wget --quiet --output-document=flutter.tar.xz https://storage.googleapis.com/flutter_infra/releases/${FLUTTER_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/bloc_flutter
cache:
directories:
- $HOME/.pub-cache
- $HOME/.gradle
- <<: *integration-test-staging
os: osx
# use oldest flutter supported version of xcode
osx_image: xcode8.0
env: bloc_flutter_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
# - git clone https://github.com/flutter/flutter.git -b stable
# - flutter precache
# install pre-compiled flutter
- FLUTTER_CHANNEL=stable
- FLUTTER_VERSION=1.0.0-${FLUTTER_CHANNEL}
- wget --quiet --output-document=flutter.zip https://storage.googleapis.com/flutter_infra/releases/${FLUTTER_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/bloc_flutter
cache:
directories:
- $HOME/.pub-cache
- <<: *integration-test-staging
os: linux
env: built_redux_android
script: travis_retry ./scripts/ci.sh ./example/built_redux
- <<: *integration-test-staging
os: osx
osx_image: xcode8.0
env: built_redux_ios
before_install: *before_install_osx
script: travis_retry ./scripts/ci.sh ./example/built_redux
- <<: *integration-test-staging
os: linux
env: firestore_redux_android
script: travis_retry ./scripts/ci.sh ./example/firestore_redux
- <<: *integration-test-staging
os: osx
osx_image: xcode8.0
env: firestore_redux_ios
before_install: *before_install_osx
script: travis_retry ./scripts/ci.sh ./example/firestore_redux
- <<: *integration-test-staging
os: linux
env: inherited_widget_android
script: travis_retry ./scripts/ci.sh ./example/inherited_widget
- <<: *integration-test-staging
os: osx
osx_image: xcode8.0
env: inherited_widget_ios
before_install: *before_install_osx
script: travis_retry ./scripts/ci.sh ./example/inherited_widget
- <<: *integration-test-staging
os: linux
env: mvc_android
script: travis_retry ./scripts/ci.sh ./example/mvc
- <<: *integration-test-staging
os: osx
osx_image: xcode8.0
env: mvc_ios
before_install: *before_install_osx
script: travis_retry ./scripts/ci.sh ./example/mvc
- <<: *integration-test-staging
os: linux
env: mvi_flutter_android
script: travis_retry ./scripts/ci.sh ./example/mvi_flutter
- <<: *integration-test-staging
os: osx
osx_image: xcode8.0
env: mvi_flutter_ios
before_install: *before_install_osx
script: travis_retry ./scripts/ci.sh ./example/mvi_flutter
- <<: *integration-test-staging
os: linux
env: mvu_android
script: travis_retry ./scripts/ci.sh ./example/mvu
- <<: *integration-test-staging
os: osx
osx_image: xcode8.0
env: mvu_ios
before_install: *before_install_osx
script: travis_retry ./scripts/ci.sh ./example/mvu
- <<: *integration-test-staging
os: linux
env: redurx_android
script: travis_retry ./scripts/ci.sh ./example/redurx
- <<: *integration-test-staging
os: osx
osx_image: xcode8.0
env: redurx_ios
before_install: *before_install_osx
script: travis_retry ./scripts/ci.sh ./example/redurx
- <<: *integration-test-staging
os: linux
env: redux_android
script: travis_retry ./scripts/ci.sh ./example/redux
- <<: *integration-test-staging
os: osx
osx_image: xcode8.0
env: redux_ios
before_install: *before_install_osx
script: travis_retry ./scripts/ci.sh ./example/redux
- <<: *integration-test-staging
os: linux
env: scoped_model_android
script: travis_retry ./scripts/ci.sh ./example/scoped_model
- <<: *integration-test-staging
os: osx
osx_image: xcode8.0
env: scoped_model_ios
before_install: *before_install_osx
script: travis_retry ./scripts/ci.sh ./example/scoped_model
- <<: *integration-test-staging
os: linux
env: simple_bloc_flutter_android
script: travis_retry ./scripts/ci.sh ./example/simple_bloc_flutter
- <<: *integration-test-staging
os: osx
osx_image: xcode8.0
env: simple_bloc_flutter_ios
before_install: *before_install_osx
script: travis_retry ./scripts/ci.sh ./example/simple_bloc_flutter
- <<: *integration-test-staging
os: linux
env: vanilla_android
script: travis_retry ./scripts/ci.sh ./example/vanilla
- <<: *integration-test-staging
os: osx
osx_image: xcode8.0
env: vanilla_ios
before_install: *before_install_osx
script: travis_retry ./scripts/ci.sh ./example/vanilla
- stage: Ready to deploy
os: osx
language: generic
env: not implemented 🤓
script: echo "Deploying to store ..."
allow_failures:
- env: mvu_android
- env: mvu_ios
- env: redurx_android