Skip to content

Instantly share code, notes, and snippets.

@GuilhE
Last active May 3, 2020
Embed
What would you like to do?
Travis CI for testing with emulator and update jacocoTestReport to codecov
language: android
dist: trusty
notifications:
email: false
jdk:
- oraclejdk8
env:
global:
- ADB_INSTALL_TIMEOUT=10
- ANDROID_API_LEVEL=28
- ANDROID_BUILD_TOOLS_VERSION=29.0.2
- EMU_NAME=test
- EMU_API_LEVEL=23
- EMU_ABI=armeabi-v7a
# - EMU_ABI=x86
android:
components:
- tools
- platform-tools
- build-tools-$ANDROID_BUILD_TOOLS_VERSION
- android-$ANDROID_API_LEVEL
- android-$EMU_API_LEVEL
- extra-android-support
- sys-img-$EMU_ABI-google_apis-$EMU_API_LEVEL
licenses:
- 'android-sdk-license-.+'
before_install:
- chmod +x gradlew
# https://github.com/travis-ci/travis-ci/issues/8874#issuecomment-350350607
- yes | sdkmanager "platforms;android-$ANDROID_API_LEVEL"
- yes | sdkmanager "platforms;android-$EMU_API_LEVEL"
before_script:
- ./gradlew build jacocoTestReport assembleAndroidTest
- echo no | android create avd --force -n $EMU_NAME -t android-$EMU_API_LEVEL --abi google_apis/$EMU_ABI
# Do not remove '-no-window' from the next instruction because "Waiting for emulator to start" will return super fast
# and then, inside 'script:', we'll receive an error because apparently there's no device ready
- emulator -avd $EMU_NAME -no-window &
- android-wait-for-emulator
- adb shell input keyevent 82 &
script:
- ./gradlew connectedCheck --stacktrace
after_success:
- bash <(curl -s https://codecov.io/bash)
branches:
only:
- master
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment