forked from bryant1410/Atlas-Android-Messenger
-
Notifications
You must be signed in to change notification settings - Fork 0
/
circle.yml
51 lines (43 loc) · 1.95 KB
/
circle.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
machine:
environment:
PATH: "~/$CIRCLE_PROJECT_REPONAME/gradle-2.9/bin:$PATH"
TERM: "dumb"
QEMU_AUDIO_DRV: none
ADB_INSTALL_TIMEOUT: "10"
GRADLE_OPTS: '-Dorg.gradle.jvmargs="-Xmx2048m -XX:+HeapDumpOnOutOfMemoryError"'
checkout:
post:
- git submodule sync
- git submodule update --init
- eval "$DUMMY_GOOGLE_SERVICES_JSON_CONFIG"
dependencies:
pre:
# Update android sdk + tools + the specific emulator we want
- echo y | android update sdk --no-ui --all --filter build-tools-25.0.2
- echo y | android update sdk --no-ui --all --filter android-19
- echo y | android update sdk --no-ui --all --filter sys-img-armeabi-v7a-google_apis-19
- echo y | android update sdk --no-ui --all --filter platform-tools
# Create a new avd targeting the version we want. Currently v19 is the most stable option
- echo no | android create avd --force -n layer-android19 --target android-19 --tag google_apis
override:
# --console=plain for better formatting, as recommended by CircleCI
- ./gradlew dependencies --console=plain
test:
override:
# Start the emulator. We're running UI tests, and thus need a window. Do not use the -no-window option
- emulator -avd layer-android19 -gpu mesa:
background: true
parallel: true
# Wait for it to have booted
- circle-android wait-for-boot
# Unlock the emulator screen after 15 seconds
- sleep 15
- adb shell input keyevent 82
# Run all tests against the emulator
- ./gradlew connectedAndroidTest test -PpreDexEnabled=false --console=plain
# 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
# Take a screenshot - Might be helpful if things are going wrong
- adb shell screencap -p | perl -pe 's/\x0D\x0A/\x0A/g' > $CIRCLE_ARTIFACTS/screen-$(date +"%T").png