Skip to content

Commit 97c42ca

Browse files
adding circle ci config file (#154)
* adding circle ci config file * use API 17 and API 25. require only build api 17 and api 25
1 parent afedddc commit 97c42ca

File tree

1 file changed

+103
-0
lines changed

1 file changed

+103
-0
lines changed

.circleci/config.yml

Lines changed: 103 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,103 @@
1+
version: 2
2+
jobs:
3+
build:
4+
working_directory: ~/android-code
5+
docker:
6+
- image: circleci/android:api-26-alpha
7+
environment:
8+
JVM_OPTS: -Xmx3200m
9+
steps:
10+
- checkout
11+
- restore_cache:
12+
key: jars-{{ checksum "build.gradle" }}-{{ checksum "test-app/build.gradle" }}
13+
- run:
14+
name: Download Dependencies
15+
command: ./gradlew androidDependencies
16+
- run:
17+
name: Run Tests
18+
command: ./gradlew lint test
19+
- save_cache:
20+
paths:
21+
- ~/.gradle
22+
key: jars-{{ checksum "build.gradle" }}-{{ checksum "test-app/build.gradle" }}
23+
test_api_version_25:
24+
working_directory: ~/android-code
25+
docker:
26+
- image: circleci/android:api-26-alpha
27+
environment:
28+
JVM_OPTS: -Xmx3200m
29+
JAVA_OPTIONS: -Djava.io.tmpdir=/var/tmp
30+
steps:
31+
- checkout
32+
- run:
33+
name: List emulators
34+
command: avdmanager list
35+
- run:
36+
name: List SDK
37+
command: sdkmanager --list
38+
- run:
39+
name: Setup emulator
40+
command: sdkmanager "system-images;android-25;google_apis;armeabi-v7a" && echo "no" | avdmanager create avd -n test -k "system-images;android-25;google_apis;armeabi-v7a"
41+
- run:
42+
name: Launch emulator
43+
command: export LD_LIBRARY_PATH=${ANDROID_HOME}/emulator/lib64:${ANDROID_HOME}/emulator/lib64/qt/lib && emulator64-arm -avd test -noaudio -no-boot-anim -no-window -accel on
44+
background: true
45+
- run:
46+
name: Wait emulator
47+
command: |
48+
# wait for it to have booted
49+
circle-android wait-for-boot
50+
# unlock the emulator screen
51+
sleep 30
52+
adb shell input keyevent 82
53+
- run:
54+
name: Unit testing
55+
command: ./gradlew testAllModulesTravis
56+
- store_artifacts:
57+
path: test-app/build/reports
58+
destination: reports
59+
- store_test_results:
60+
path: test-app/build/test-results
61+
62+
test_api_version_17:
63+
working_directory: ~/android-code
64+
docker:
65+
- image: circleci/android:api-26-alpha
66+
environment:
67+
JVM_OPTS: -Xmx3200m
68+
steps:
69+
- checkout
70+
- run:
71+
name: Setup emulator
72+
command: sdkmanager "system-images;android-17;default;armeabi-v7a" && echo "no" | avdmanager create avd -n test -k "system-images;android-17;default;armeabi-v7a"
73+
- run:
74+
name: Launch emulator
75+
command: export LD_LIBRARY_PATH=${ANDROID_HOME}/emulator/lib64:${ANDROID_HOME}/emulator/lib64/qt/lib && emulator64-arm -avd test -noaudio -no-boot-anim -no-window -accel on
76+
background: true
77+
- run:
78+
name: Wait emulator
79+
command: |
80+
# wait for it to have booted
81+
circle-android wait-for-boot
82+
# unlock the emulator screen
83+
sleep 30
84+
adb shell input keyevent 82
85+
- run:
86+
name: Run Tests
87+
command: ./gradlew testAllModulesTravis
88+
- store_artifacts:
89+
path: test-app/build/reports
90+
destination: reports
91+
- store_test_results:
92+
path: test-app/build/test-results
93+
workflows:
94+
version: 2
95+
build_test:
96+
jobs:
97+
- build
98+
- test_api_version_25:
99+
requires:
100+
- build
101+
- test_api_version_17:
102+
requires:
103+
- build

0 commit comments

Comments
 (0)