-
Notifications
You must be signed in to change notification settings - Fork 6
/
.travis.yml
336 lines (323 loc) · 14.2 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
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
branches:
except:
# These branches are used by Bors-NG and therefore, should not be build by Travis CI.
# https://bors.tech/documentation/getting-started/
- master.tmp
- staging.tmp
- trying.tmp
# https://stackoverflow.com/questions/27644586/how-to-set-up-travis-ci-with-multiple-languages
matrix:
include:
- name: Lint check code
language: python
sudo: false
python: "3.6"
install:
- pip install -r requirements.txt
- pip install pylint
script:
- ./tests/lint_check_python3.sh
- name: Test doctor against OpenJDK9
dist: trusty
# OpenJDK9 testing (Android language on Travis does not support JDK9)
language: java
python: "3.7"
sudo: required # For pip installation, otherwise, pip install fails.
jdk: oraclejdk9
before_script:
- sudo apt-get install -y python3-pip
- sudo apt-get install -y python3-setuptools
- pip3 install --user -r requirements.txt
- jdk_switcher use oraclejdk9
script:
# Assert failure
- python3 src/main.py doctor --verbose && exit 1 || exit 0
- name: Test doctor against JDK8
language: android # Doctor testing
python: "3.7"
sudo: required # For pip installation, otherwise, pip install fails.
jdk: oraclejdk8
before_script:
- sudo apt-get install python3-pip
- pip3 install --user -r requirements.txt
- jdk_switcher use oraclejdk8
script:
- python3 src/main.py install basic packages
- python3 src/main.py doctor --verbose
- python3 src/main.py list api versions --arm | grep armeabi-v7a
- python3 src/main.py list api versions --google-apis | grep google_apis
- python3 src/main.py list api versions --arm --no-google-apis | grep default
- name: Test list packages commands on JDK8
language: android # list testing
python: "3.7"
sudo: required # For pip installation, otherwise, pip install fails.
jdk: oraclejdk8
before_script:
- sudo apt-get install python3-pip
- pip3 install --user -r requirements.txt
- jdk_switcher use oraclejdk8
script:
- python3 src/main.py list api versions --arm
- python3 src/main.py list api versions --google-apis
- python3 src/main.py list api versions --arm --no-google-apis
- python3 src/main.py list build tools
- python3 src/main.py list installed packages
- python3 src/main.py list other packages
- name: Test installation with list packages
language: android # list testing
python: "3.7"
sudo: required # For pip installation, otherwise, pip install fails.
jdk: oraclejdk8
before_script:
- sudo apt-get install python3-pip
- jdk_switcher use oraclejdk8
- cp -r -v src/* release/androide/
- cp README.md release/README.md
- sudo python3 -m pip install -e release
script:
- androidtool list api versions --arm
- androidtool list api versions --google-apis
- androidtool list api versions --arm --no-google-apis
- androidtool list build tools
- androidtool list installed packages
- androidtool list other packages
- androidtool install basic packages
# Install testing is slow, split it into multiple
- name: Test install API 4 and API 14 on JDK8
language: android
python: "3.7"
sudo: required # For pip installation, otherwise, pip install fails.
jdk: oraclejdk8
before_script:
- sudo apt-get install python3-pip
- pip3 install --user -r requirements.txt
- jdk_switcher use oraclejdk8
script:
- python3 src/main.py install version 4 --verbose
- python3 src/main.py install version 14 --arm
- python3 src/main.py install version 27 --x86
- python3 src/main.py list installed packages | grep android-4
- python3 src/main.py list installed packages | grep android-14
# TODO(ashishb): Make this work, for now, it just hangs.
# - python3 src/main.py update all --verbose
- name: Test install API 27 on JDK8
language: android
python: "3.7"
sudo: required # For pip installation, otherwise, pip install fails.
jdk: oraclejdk8
before_script:
- sudo apt-get install python3-pip
- pip3 install --user -r requirements.txt
- jdk_switcher use oraclejdk8
script:
- python3 src/main.py install version 27 --x86
- python3 src/main.py list installed packages | grep android-27
- name: Test install API 28 on JDK8
language: android
python: "3.7"
sudo: required # For pip installation, otherwise, pip install fails.
jdk: oraclejdk8
before_script:
- sudo apt-get install python3-pip
- pip3 install --user -r requirements.txt
- jdk_switcher use oraclejdk8
script:
- python3 src/main.py install version 28 --x86_64 --google-apis -v
- python3 src/main.py list installed packages | grep android-28
# TODO(ashishb): Make this work, for now, it just hangs.
# For example, https://travis-ci.org/ashishb/android-sdk-enhanced/jobs/459599488
# - name: Test update command
# language: android
# python:
# - 3.7
# sudo: required # For pip installation, otherwise, pip install fails.
# jdk: oraclejdk8
# before_script:
# - sudo apt-get install python3-pip
# - pip3 install --user -r requirements.txt
# - jdk_switcher use oraclejdk8
# script:
# - python3 src/main.py list installed packages
# - touch ~/.android/repositories.cfg
# - python3 src/main.py update all --verbose
- name: Test list avds command
dist: trusty
language: java
python: "3.7"
sudo: required # For pip installation, otherwise, pip install fails.
jdk: oraclejdk8
cache:
directories:
# Android SDK
- $HOME/android-sdk-dl
- $HOME/android-sdk
# Android build cache (see http://tools.android.com/tech-docs/build-cache)
- $HOME/.android/build-cache
before_script:
# Python
- sudo apt-get install python3-pip
- pip3 install --user -r requirements.txt
- jdk_switcher use oraclejdk8
- touch $HOME/.android/repositories.cfg
# Android
# Download and unzip the Android SDK tools (if not already there thanks to the cache mechanism)
# Latest version available here: https://developer.android.com/studio/#command-tools
- if test ! -e $HOME/android-sdk-dl/sdk-tools.zip ; then curl https://dl.google.com/android/repository/sdk-tools-linux-4333796.zip > $HOME/android-sdk-dl/sdk-tools.zip ; fi
- unzip -qq -n $HOME/android-sdk-dl/sdk-tools.zip -d $HOME/android-sdk
# Install or update Android SDK components (will not do anything if already up to date thanks to the cache mechanism)
- echo y | $HOME/android-sdk/tools/bin/sdkmanager 'tools' > /dev/null
script:
- touch $HOME/.android/repositories.cfg
- export ANDROID_SDK_ROOT=$HOME/android-sdk
- python3 src/main.py list avds --verbose
- name: Test create and start AVD API 24 command on JDK8
dist: trusty
language: java
python: "3.7"
sudo: required # For pip installation, otherwise, pip install fails.
jdk: oraclejdk8
cache:
directories:
# Android SDK
- $HOME/android-sdk-dl
# Don't cache SDK since it slows down the test
# - $HOME/android-sdk
# Android build cache (see http://tools.android.com/tech-docs/build-cache)
- $HOME/.android/build-cache
before_script:
# Python
- sudo apt-get install python3-pip
- sudo apt-get install android-tools-adb
- pip3 install --user -r requirements.txt
- jdk_switcher use oraclejdk8
- touch $HOME/.android/repositories.cfg
# Android
# Download and unzip the Android SDK tools (if not already there thanks to the cache mechanism)
# Latest version available here: https://developer.android.com/studio/#command-tools
- if test ! -e $HOME/android-sdk-dl/sdk-tools.zip ; then curl https://dl.google.com/android/repository/sdk-tools-linux-4333796.zip > $HOME/android-sdk-dl/sdk-tools.zip ; fi
- unzip -qq -n $HOME/android-sdk-dl/sdk-tools.zip -d $HOME/android-sdk
# Install or update Android SDK components (will not do anything if already up to date thanks to the cache mechanism)
- echo y | $HOME/android-sdk/tools/bin/sdkmanager 'tools' > /dev/null
script:
- set -e
- touch $HOME/.android/repositories.cfg
- export ANDROID_SDK_ROOT=$HOME/android-sdk
- python3 src/main.py install basic packages
- python3 src/main.py create avd test_avd1 24 --arm --google-apis
- python3 src/main.py list installed packages
- python3 src/main.py list avds
- python3 src/main.py list avds | grep test_avd1
# Only ARM version can be tested on Travis CI
- python3 src/main.py start avd test_avd1 --headless --verbose &
- adb wait-for-device
- kill %1
# Without this, the test fails mysteriously
# see http://travis-ci.org/ashishb/androidtool/builds/598498218
- set +e
- name: Test create AVD API 28 command on JDK8
dist: trusty
language: java
python: "3.7"
sudo: required # For pip installation, otherwise, pip install fails.
jdk: oraclejdk8
cache:
directories:
# Android SDK
- $HOME/android-sdk-dl
# Don't cache SDK since it slows down the test
# - $HOME/android-sdk
# Android build cache (see http://tools.android.com/tech-docs/build-cache)
- $HOME/.android/build-cache
before_script:
# Python
- sudo apt-get install python3-pip
- pip3 install --user -r requirements.txt
- jdk_switcher use oraclejdk8
- touch $HOME/.android/repositories.cfg
# Android
# Download and unzip the Android SDK tools (if not already there thanks to the cache mechanism)
# Latest version available here: https://developer.android.com/studio/#command-tools
- if test ! -e $HOME/android-sdk-dl/sdk-tools.zip ; then curl https://dl.google.com/android/repository/sdk-tools-linux-4333796.zip > $HOME/android-sdk-dl/sdk-tools.zip ; fi
- unzip -qq -n $HOME/android-sdk-dl/sdk-tools.zip -d $HOME/android-sdk
# Install or update Android SDK components (will not do anything if already up to date thanks to the cache mechanism)
- echo y | $HOME/android-sdk/tools/bin/sdkmanager 'tools' > /dev/null
script:
- set -e
- touch $HOME/.android/repositories.cfg
- export ANDROID_SDK_ROOT=$HOME/android-sdk
- python3 src/main.py create avd test_avd2 28 --x86 --no-google-apis
- python3 src/main.py list installed packages
- python3 src/main.py list avds
- python3 src/main.py list avds | grep test_avd2
- name: Test create AVD API 25 command on JDK8
dist: trusty
language: java
python: "3.7"
sudo: required # For pip installation, otherwise, pip install fails.
jdk: oraclejdk8
cache:
directories:
# Android SDK
- $HOME/android-sdk-dl
# Don't cache SDK since it slows down the test
# - $HOME/android-sdk
# Android build cache (see http://tools.android.com/tech-docs/build-cache)
- $HOME/.android/build-cache
before_script:
# Python
- sudo apt-get install python3-pip
- pip3 install --user -r requirements.txt
- jdk_switcher use oraclejdk8
- touch $HOME/.android/repositories.cfg
# Android
# Download and unzip the Android SDK tools (if not already there thanks to the cache mechanism)
# Latest version available here: https://developer.android.com/studio/#command-tools
- if test ! -e $HOME/android-sdk-dl/sdk-tools.zip ; then curl https://dl.google.com/android/repository/sdk-tools-linux-4333796.zip > $HOME/android-sdk-dl/sdk-tools.zip ; fi
- unzip -qq -n $HOME/android-sdk-dl/sdk-tools.zip -d $HOME/android-sdk
# Install or update Android SDK components (will not do anything if already up to date thanks to the cache mechanism)
- echo y | $HOME/android-sdk/tools/bin/sdkmanager 'tools' > /dev/null
script:
- set -e
- touch $HOME/.android/repositories.cfg
- export ANDROID_SDK_ROOT=$HOME/android-sdk
- python3 src/main.py list avds --verbose
- python3 src/main.py create avd test_avd3 25
- python3 src/main.py list installed packages
- python3 src/main.py list avds
- python3 src/main.py list avds | grep test_avd3
- name: Test installation with list packages (OSX)
os: osx
language: android # list testing
sudo: required # For pip installation, otherwise, pip install fails.
# For JDK 8, https://docs.travis-ci.com/user/reference/osx/#jdk-and-macos
osx_image: xcode9.3
before_cache:
- brew cleanup
cache:
directories:
- $HOME/Library/Caches/Homebrew
before_script:
# - jdk_switcher use oraclejdk8
- cp -r -v src/* release/androide/
- cp README.md release/README.md
# this seems to be failing due to some bug in Homebrew
# https://travis-ci.org/ashishb/androidtool/jobs/625531290
- brew upgrade python || true
# Fails with "python 2.7.14_2 is already installed"
# - brew install python3
- python3 --version
- virtualenv venv -p python3
- source venv/bin/activate
- sudo python3 -m pip install -e release
- brew cask install android-sdk
script:
- set -e
# Assert that this command failed
- androidtool doctor && false || true
- androidtool list api versions --arm
- androidtool list api versions --google-apis
- androidtool list api versions --arm --no-google-apis
- androidtool list build tools
- androidtool list installed packages
- androidtool list other packages
- androidtool install basic packages