Skip to content

Instantly share code, notes, and snippets.

@aoudiamoncef
Created November 7, 2017 13:44
Show Gist options
  • Save aoudiamoncef/a02ff152f7dd8747e81e76bca5079b9d to your computer and use it in GitHub Desktop.
Save aoudiamoncef/a02ff152f7dd8747e81e76bca5079b9d to your computer and use it in GitHub Desktop.
Android continuous integration using Travis CI (build, unit tests and connected tests using AVD)
sudo: required
language: android
jdk: oraclejdk8
before_cache:
- rm -f $HOME/.gradle/caches/modules-2/modules-2.lock
- rm -rf $HOME/.gradle/caches/*/plugin-resolution/
cache:
directories:
- $HOME/.gradle/caches/
- $HOME/.gradle/wrapper/
- $HOME/.android/build-cache
env:
global:
- ANDROID_API_LEVEL=26
- ANDROID_BUILD_TOOLS=26.0.2
- ANDROID_EMU_API_LEVEL=21
- ANDROID_ABI=armeabi-v7a
- ADB_INSTALL_TIMEOUT=20 # minutes (2 minutes by default)
- QEMU_AUDIO_DRV=none # Remove audio
android:
components:
- tools
- tools # Running this twice get's the latest build tools (https://github.com/codepath/android_guides/wiki/Setting-up-Travis-CI)
- platform-tools
- android-$ANDROID_API_LEVEL
- build-tools-$ANDROID_BUILD_TOOLS
- android-$ANDROID_EMU_API_LEVEL
- extra
- sys-img-$ANDROID_ABI-google_apis-$ANDROID_EMU_API_LEVEL
before_script:
- echo no | android create avd --force -n test -t android-$ANDROID_EMU_API_LEVEL --abi google_apis/$ANDROID_ABI
- emulator -avd test -no-window &
- android-wait-for-emulator
- adb shell input keyevent 82 &
script:
- android list target
- ./gradlew clean test build
- ./gradlew connectedCheck
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment