Last active
January 2, 2017 11:34
-
-
Save SubhrajyotiSen/3df28aaa7bb86b716c34dd6748db0c88 to your computer and use it in GitHub Desktop.
Travis CI configuration for Android
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
language: android | |
jdk: oraclejdk8 | |
sudo: false | |
env: | |
matrix: | |
- ANDROID_TARGET=android-19 ANDROID_ABI=armeabi-v7a | |
- ANDROID_TARGET=android-21 ANDROID_ABI=armeabi-v7a | |
global: | |
- ADB_INSTALL_TIMEOUT=10 #Time out to 10 mins | |
before_cache: | |
- rm -f $HOME/.gradle/caches/modules-2/modules-2.lock | |
cache: | |
directories: #Cache all dirs under .gradle folder | |
- $HOME/.gradle/daemon #Cache daemon logs | |
- $HOME/.gradle/native #Cache library downloaded from the gradle dependency | |
- $HOME/.gradle/wrapper #Cache the gradle | |
android: | |
update_sdk: true | |
components: | |
- platform-tools | |
- tools | |
- build-tools-25.0.2 | |
- android-25 | |
# Additional components | |
- extra-google-google_play_services | |
- extra-google-m2repository | |
- extra-android-m2repository | |
#system images | |
- sys-img-armeabi-v7a-android-19 | |
- sys-img-armeabi-v7a-android-21 | |
licenses: | |
- 'android-sdk-preview-license-52d11cd2' | |
- 'android-sdk-license-.+' | |
- 'google-gdk-license-.+' | |
before_script: | |
- chmod +x gradlew #Grand permissions | |
- android list targets | |
- echo no | android create avd --force --name test --target $ANDROID_TARGET --abi $ANDROID_ABI #Create AVD for given api | |
- emulator -avd test -no-skin -no-audio -no-window & #Start emulator | |
script: | |
- echo "Travis branch is $TRAVIS_BRANCH" | |
- echo "Travis branch is in pull request $TRAVIS_PULL+REQUEST" | |
- android-wait-for-emulator | |
- adb devices #Display list of devices | |
- adb shell input keyevent 82 & | |
- ./gradlew connectedCheck -PdisablePreDex --stacktrace | |
before_install: | |
- pip install --user codecov #Install codecov | |
after_success: | |
- codecov #Run codecov | |
after_failure: "cat $TRAVIS_BUILD_DIR/app/build/outputs/lint-results-debug.xml" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment