Skip to content

Instantly share code, notes, and snippets.

@jaredsburrows
Created February 10, 2018 05:19
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jaredsburrows/d8c45d926e6417507a759676fecaaa91 to your computer and use it in GitHub Desktop.
Save jaredsburrows/d8c45d926e6417507a759676fecaaa91 to your computer and use it in GitHub Desktop.
language: android
env:
global:
- ADB_INSTALL_TIMEOUT=8
jdk:
- oraclejdk8
before_install:
# Download SDK
- echo yes | sdkmanager "tools" &>/dev/null
- echo yes | sdkmanager "platform-tools" &>/dev/null
- echo yes | sdkmanager "build-tools;27.0.3" &>/dev/null
- echo yes | sdkmanager "platforms;android-27" &>/dev/null
# Download emulator
- echo yes | sdkmanager "platforms;android-19" &>/dev/null
- echo yes | sdkmanager "system-images;android-19;default;armeabi-v7a" &>/dev/null
# Update remaining dependencies and accept licenses
- echo yes | sdkmanager --update &>/dev/null
- echo yes | sdkmanager --licenses &>/dev/null
# Setup emulator
- echo no | avdmanager create avd --force -n test -k "system-images;android-19;default;armeabi-v7a" &>/dev/null
- $ANDROID_HOME/emulator/emulator -avd test -no-audio -no-window & &>/dev/null
install:
# Build debug and release(run proguard)
- ./gradlew clean assemble assembleDebugAndroidTest -Pci -s --scan
before_script:
# Make sure the emulator is available
- android-wait-for-emulator
# Turn off animations
- adb shell settings put global window_animation_scale 0 &
- adb shell settings put global transition_animation_scale 0 &
- adb shell settings put global animator_duration_scale 0 &
# For Multidex issue for devices API < 19
- adb shell setprop dalvik.vm.dexopt-flags v=n,o=v
- adb shell stop installd
- adb shell start installd
# Wake up
- adb shell input keyevent 82 &
script:
# Run all checks
- ./gradlew testDebug connectedDebugAndroidTest createDebugCoverageReport jacocoDebugReport coveralls -Pci -s --scan
branches:
except:
- gh-pages
sudo: false
before_cache:
- rm -f $HOME/.gradle/caches/modules-2/modules-2.lock
- rm -fr $HOME/.gradle/caches/*/plugin-resolution/
cache:
directories:
- $HOME/.gradle/caches/
- $HOME/.gradle/wrapper/
- $HOME/.android/build-cache
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment