-
Notifications
You must be signed in to change notification settings - Fork 29
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Build] Code coverage report and run android test with emulator (#38)
- Integrate codecov - Enable android test with emulator in travis-ci
- Loading branch information
Showing
4 changed files
with
102 additions
and
18 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,60 @@ | ||
language: android | ||
dist: trusty | ||
|
||
jdk: | ||
- oraclejdk8 | ||
|
||
env: | ||
global: | ||
- ADB_INSTALL_TIMEOUT=8 | ||
- ABI=x86_64 | ||
- EMU_FLAVOR=default | ||
- ANDROID_HOME=/usr/local/android-sdk | ||
- TOOLS=${ANDROID_HOME}/tools | ||
- PATH=${ANDROID_HOME}:${ANDROID_HOME}/emulator:${TOOLS}:${TOOLS}/bin:${ANDROID_HOME}/platform-tools:${PATH} | ||
matrix: | ||
- API=25 | ||
|
||
android: | ||
components: | ||
- build-tools-28.0.3 | ||
- android-28 | ||
- extra-google-m2repository | ||
- extra-android-m2repository | ||
- tools | ||
|
||
licenses: | ||
- 'android-sdk-preview-license-.+' | ||
- 'android-sdk-license-.+' | ||
- 'google-gdk-license-.+' | ||
|
||
install: | ||
- echo 'count=0' > /home/travis/.android/repositories.cfg | ||
- echo y | sdkmanager "platform-tools" >/dev/null | ||
- echo y | sdkmanager "tools" >/dev/null | ||
- echo y | sdkmanager "build-tools;28.0.3" >/dev/null | ||
- echo y | sdkmanager "platforms;android-$API" >/dev/null | ||
- echo y | sdkmanager "platforms;android-28" >/dev/null | ||
- echo y | sdkmanager --channel=4 "emulator" >/dev/null | ||
- echo y | sdkmanager "extras;android;m2repository" >/dev/null | ||
- echo y | sdkmanager "system-images;android-$API;$EMU_FLAVOR;$ABI" >/dev/null | ||
- echo no | avdmanager create avd --force -n test -k "system-images;android-$API;$EMU_FLAVOR;$ABI" -c 10M | ||
- emulator -verbose -avd test -no-accel -no-snapshot -no-window $AUDIO -camera-back none -camera-front none -selinux permissive -qemu -m 2048 & | ||
- android-wait-for-emulator | ||
- adb shell input keyevent 82 & | ||
- adb shell dumpsys window windows | grep -E 'mCurrentFocus|mFocusedApp' | ||
- adb shell input touchscreen swipe 16 239 304 287 | ||
- adb shell dumpsys window windows | grep -E 'mCurrentFocus|mFocusedApp' | ||
|
||
script: ./gradlew clean app:lint jacocoTestReport app:assembleRelease | ||
|
||
after_success: | ||
- bash <(curl -s https://codecov.io/bash) | ||
|
||
after_failure: | ||
- adb shell dumpsys window windows | grep -E 'mCurrentFocus|mFocusedApp' | ||
- adb shell "uiautomator dump /sdcard/view.xml; cat /sdcard/view.xml" | ||
|
||
before_cache: | ||
- rm -f $HOME/.gradle/caches/modules-2/modules-2.lock | ||
|
||
script: ./gradlew clean app:lint app:testDebugUnitTest app:assembleRelease | ||
cache: | ||
directories: | ||
- $HOME/.gradle/caches/ | ||
- $HOME/.gradle/wrapper/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters