forked from facebook/fresco
-
Notifications
You must be signed in to change notification settings - Fork 0
/
circle.yml
66 lines (65 loc) · 2.51 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
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
aliases:
# Cache Management
- &restore-cache-gradle
keys:
- v1-gradle-{{ arch }}-{{ .Branch }}-{{ checksum "build.gradle" }}-{{ checksum "gradle.properties" }}
# Fallback in case checksum fails
- v1-gradle-{{ arch }}-{{ .Branch }}-{{ checksum "build.gradle" }}-
- v1-gradle-{{ arch }}-{{ .Branch }}-
# Fallback in case this is a first-time run on a fork
- v1-gradle-{{ arch }}-master-
- &save-cache-gradle
paths:
- ~/.gradle
key: v1-gradle-{{ arch }}-{{ .Branch }}-{{ checksum "build.gradle" }}-{{ checksum "gradle.properties" }}
version: 2
jobs:
build:
working_directory: ~/fresco
docker:
- image: circleci/android:api-27-alpha
steps:
- checkout
- run:
name: Setup NDK
command: |
wget --quiet https://dl.google.com/android/repository/android-ndk-r17b-linux-x86_64.zip
unzip -q android-ndk-r17b-linux-x86_64.zip -d /home/circleci
echo "ndk.dir=/home/circleci/android-ndk-r17b" >> /home/circleci/fresco/local.properties
- run:
name: "NDK Fix: https://github.com/android-ndk/ndk/issues/188"
command: sudo apt-get install file
- run:
name: Setup emulator
command: |
sdkmanager "system-images;android-19;default;armeabi-v7a"
echo "no" | avdmanager create avd -n test -k "system-images;android-19;default;armeabi-v7a"
- run:
name: Launch emulator
command: emulator -avd test -no-audio -no-window
background: true
- run:
name: Wait for emulator
command: |
chmod +x android-wait-for-emulator
./android-wait-for-emulator
- run:
name: Remove lock screen
command: adb shell input keyevent 82
- restore-cache: *restore-cache-gradle
- run:
name: Run Tests
command: ./gradlew test assembleDebug -PdisablePreDex
- save-cache: *save-cache-gradle
- run:
name: Run Instrumentation Tests
command: |
./gradlew :samples:showcase:connectedInternalInstrumentationAndroidTest -PdisablePreDex
- run:
name: Copy Results
command: |
mkdir -p /home/circleci/test-results/junit
find . -type f -regex ".*/build/test-results/.*xml" -exec cp {} /home/circleci/test-results/junit \;
cp -r samples/showcase/build/reports/androidTests /home/circleci/test-results
- test-results-store:
path: /home/circleci/test-results