-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathcircle.yml
More file actions
104 lines (88 loc) · 4.25 KB
/
circle.yml
File metadata and controls
104 lines (88 loc) · 4.25 KB
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
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
machine:
node:
version: 5.5.0
java:
version: openjdk8
environment:
ADB_INSTALL_TIMEOUT: "10"
# GRADLE_OPTS: '-Dorg.gradle.jvmargs="-Xmx2048m -XX:+HeapDumpOnOutOfMemoryError"'
post:
## Creates a random introspective tunnel to the CircleCI container
#- wget https://bin.equinox.io/c/4VmDzA7iaHb/ngrok-stable-linux-amd64.zip
#- unzip ngrok-stable-linux-amd64.zip
#- ./ngrok http -log $CIRCLE_ARTIFACTS/ngrok.log -log-level debug -log-format json 9292:
# background: true
#- sleep 2
## Save the NGROK URL by using the API on the ngrok server and appending the desired callback url
#- echo "$(curl 127.0.0.1:4040/api/tunnels | jq '.tunnels[0].public_url' -r)"/reply > UoitDCLibraryBooking/ngrok_url.txt
dependencies:
override:
#- npm install:
# pwd:
# device_farm_receive_server
# Ensures gradle is running well before starting the tests
- ./gradlew tasks
pre:
- if ! $(grep -q "Revision=25.1.7" $ANDROID_HOME/tools/source.properties); then echo y | android update sdk --no-ui --all --filter "tools"; fi
- if ! $(grep -q "Pkg.Revision=35.0.0" $ANDROID_HOME/extras/android/m2repository/source.properties); then echo y | android update sdk --no-ui --all --filter "extra-android-m2repository"; fi
- if ! $(grep -q "Pkg.Revision=32.0.0" $ANDROID_HOME/extras/google/m2repository/source.properties); then echo y | android update sdk --no-ui --all --filter "extra-google-m2repository"; fi
- if ! $(grep -q "Pkg.Revision=32.0.0" $ANDROID_HOME/extras/google/google_play_services/source.properties); then echo y | android update sdk --no-ui --all --filter "extra-google-google_play_services"; fi
- if [ ! -e $ANDROID_HOME/build-tools/24.0.1 ]; then echo y | android update sdk --no-ui --all --filter "build-tools-24.0.1"; fi
- echo y | android update sdk --no-ui --all --filter "android-24"
post:
# Copy the standard debug keystore to the CI, ensuring all app have the same certificate
- cp app/debug.keystore ~/.android/
cache_directories:
- /usr/local/android-sdk-linux/tools
- /usr/local/android-sdk-linux/build-tools/24.0.1
- /usr/local/android-sdk-linux/extras/android/m2repository
- /usr/local/android-sdk-linux/extras/google/m2repository
- /usr/local/android-sdk-linux/extras/google/google_play_services
test:
override:
# NO DEVICE FARM
# ==============
# Assemble the AndroidTest Instrumentation build in build/outputs/apk
# - ./gradlew assembleAndroidTest
# Assemble the debug build in build/outputs/apk
#- ./gradlew assembleDebug
# Run the device_farm_receive_server and write the exit state to $DEVICE_FARM_RECEIVE_SERVER_RESPONSE
# Needs to be written to a variable because failing any command will fail the build
#- node server.js:
# pwd:
# device_farm_receive_server
#- ./scripts/circle_ci_emulator_tests.sh:
# timeout: 900
#
# ==============
# Run unit tests
- ./gradlew jacocoTestDebugUnitTestReport --info:
timeout: 900
# Mount SD card into Linux
- mksdcard -l e 512M mysdcard.img
# Start the emulator and attach SD card volume
- emulator -avd circleci-android22 -no-audio -no-window -sdcard mysdcard.img:
background: true
# Wait for emulator to boot
- circle-android wait-for-boot
# Wait a moment before Unlocking the emulator screen
- sleep 15
- adb shell input keyevent 82
# Run the instrumentation tests on the emulator
- ./gradlew spoon:
timeout: 900
# Copy spoon html output
- cp -rv app/build/outputs/debug $CIRCLE_ARTIFACTS/spoon-results
# Copy dex count information
- cp -rv app/build/outputs/dexcount $CIRCLE_ARTIFACTS
# Copy the Jacoco test coverage report
- cp -rv app/build/reports/jacoco/jacocoTestDebugUnitTestReport $CIRCLE_ARTIFACTS
# Copy the test results to the test results directory
- cp -rv app/build/outputs/debug/junit-reports $CIRCLE_TEST_REPORTS/junit
post:
# Post test coverage results to codecov.io
- bash <(curl -s https://codecov.io/bash)
notify:
webhooks:
# When build completes, send the Device Farm server the results so it can decide if a release is a good idea
- url: https://2yfzoqajr9.execute-api.us-east-1.amazonaws.com/prod/circlecibuildfinishwebhook