forked from appium/appium-uiautomator2-driver
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.travis.yml
94 lines (92 loc) · 3.18 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
language: android
jdk: oraclejdk8
addons:
apt:
sources:
- ubuntu-toolchain-r-test
packages:
- g++-6
android:
components:
- platform-tools
- tools
- build-tools
env:
global:
- NODE_VERSION=8
- _FORCE_LOGS=1
- DEVICE=android
- MOCHA_TIMEOUT=640000
- RECURSIVE=
- START_EMU=1
- ANDROID_EMU_NAME=test
- ANDROID_EMU_ABI=armeabi-v7a
- ANDROID_EMU_TAG=default
- ANDROID_BUILD_TOOLS=28.0.3
- ANDROID_PLATFORM=android-21
- CC=gcc-6 CXX=g++-6
matrix:
- START_EMU=0 RECURSIVE=--recursive TEST=unit COVERALLS=1
- TEST=functional
- TEST=functional/commands
- TEST=functional/commands/keyboard
- TEST=functional/commands/find OPENCV=1
- TEST=functional/commands/general
before_install:
- |
echo y | android update sdk --no-ui -t tools
echo yes | sdkmanager tools > /dev/null
echo yes | sdkmanager --update > /dev/null
echo yes | sdkmanager "build-tools;${ANDROID_BUILD_TOOLS}" > /dev/null
echo yes | sdkmanager "extras;android;m2repository" > /dev/null
echo yes | sdkmanager "extras;google;m2repository" > /dev/null
if [ ${START_EMU} = "1" ]; then
echo yes | sdkmanager "platforms;${ANDROID_PLATFORM}" > /dev/null
export ANDROID_EMU_IMAGE="system-images;${ANDROID_PLATFORM};${ANDROID_EMU_TAG};${ANDROID_EMU_ABI}"
for retry in 1 2 3; do
echo yes | sdkmanager "${ANDROID_EMU_IMAGE}" > /dev/null && break
echo "sdkmanager was not able to download the ${ANDROID_EMU_IMAGE} image (retry ${retry})"
sleep 5
done
sdkmanager --list
export TOOLS=${ANDROID_HOME}/tools
export PATH=${ANDROID_HOME}:${ANDROID_HOME}/emulator:${TOOLS}:${TOOLS}/bin:${ANDROID_HOME}/platform-tools:${PATH}
echo no | avdmanager create avd -k "${ANDROID_EMU_IMAGE}" -n "${ANDROID_EMU_NAME}" -f --abi "${ANDROID_EMU_ABI}" --tag "${ANDROID_EMU_TAG}" || exit 1
emulator -avd "${ANDROID_EMU_NAME}" -no-window -camera-back none -camera-front none &
else
sdkmanager --list
fi
install:
# node stuff
- curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.33.1/install.sh | bash
- nvm install $NODE_VERSION
- node --version
- npm --version
- npm install appium-test-support # get the travis emu scripts
- SERVER_INSTALL_ATTEMPTS=50 npm install
- npm ls
# for mjpeg stuff
- npm install --no-save mjpeg-consumer
before_script:
- |
if [ ${START_EMU} = "1" ]; then
# make sure emulator started
$(npm bin)/android-emu-travis-post;
fi
if [ ${OPENCV} = "1" ]; then
#CMAKE_URL="http://www.cmake.org/files/v3.3/cmake-3.3.1-Linux-x86_64.tar.gz"
#mkdir cmake && travis_retry wget --quiet -O - ${CMAKE_URL} | tar --strip-components=1 -xz -C cmake
#export PATH=${DEPS_DIR}/cmake/bin:${PATH}
#CC=clang-5.0 CXX=clang++-5.0 npm install opencv4nodejs
echo "Skipping opencv install for now"
fi
script:
- npm run lint && npm run mocha -- -t $MOCHA_TIMEOUT -R spec $RECURSIVE build/test/$TEST -ig @skip-ci --exit
after_success:
- if [ -n "$COVERALLS" ]; then _FORCE_LOGS=0 npm run coverage; fi
after_failure:
- |
if [ "$TEST" != "unit" ]; then
echo -e "----LOGCAT----\n"
adb logcat -d
fi