Skip to content

Instantly share code, notes, and snippets.

@rakawestu
Created August 27, 2016 10:51
Show Gist options
  • Save rakawestu/0ec8a42d51532ae10b539fbd7546d9ab to your computer and use it in GitHub Desktop.
Save rakawestu/0ec8a42d51532ae10b539fbd7546d9ab to your computer and use it in GitHub Desktop.
Circle CI Example Config for Android Automated Instrumentation Test
#
# Build configuration for Circle CI
#
general:
artifacts:
- /home/ubuntu/project-name/app/build/outputs/apk/
machine:
environment:
ANDROID_HOME: /usr/local/android-sdk-linux
dependencies:
pre:
- wget "https://services.gradle.org/distributions/gradle-2.13-bin.zip"; unzip gradle-2.13-bin.zip
- source environmentSetup.sh && copyEnvVarsToGradleProperties
override:
- echo y | android update sdk --no-ui --all --filter tools,platform-tools,build-tools-23.0.3,android-23,extra-google-m2repository,extra-google-google_play_services,extra-android-m2repository
- ANDROID_HOME=/usr/local/android-sdk-linux ./gradlew dependencies
test:
override:
# start the build
- (./gradlew assemble):
timeout: 360
# start the emulator
- emulator -avd circleci-android22 -no-audio -no-window:
background: true
parallel: true
# wait for it to have booted
- circle-android wait-for-boot
# unlock the emulator screen
- sleep 30
- adb shell input keyevent 82
# run tests against the emulator.
- ./gradlew connectedDevelopmentDebugAndroidTest -PdisablePreDex
# copy the build outputs to artifacts
- cp -r app/build/outputs $CIRCLE_ARTIFACTS
# copy the test results to the test results directory.
- cp -r app/build/outputs/androidTest-results/* $CIRCLE_TEST_REPORTS
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment