-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathcircle.yml
More file actions
79 lines (71 loc) · 2.57 KB
/
Copy pathcircle.yml
File metadata and controls
79 lines (71 loc) · 2.57 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
version: 2
defaults: &defaults
docker:
- image: monzoandroid/ci:0.11
jobs:
build_and_checks:
<<: *defaults
steps:
- checkout
- restore_cache:
key: jars-{{ checksum "build.gradle" }}-{{ checksum "app/build.gradle" }}
# Setup Cast SDK and Google Play Services config files
- run: echo "castId=$CAST_APP_ID" >> app/cast.properties
- run: echo "$GOOGLE_PLAY_SERVICES_FILE" >> app/google-services.json
- run:
name: Compile app apk and espresso tests apk
command: ./gradlew assembleDebug assembleDebugAndroidTest --stacktrace --no-daemon
- save_cache:
key: apks-{{ .Revision }}
paths:
- app/build/outputs/apk/
- store_artifacts:
path: app/build/outputs/apk/
destination: apks/
- store_artifacts:
path: app/build/reports/
destination: reports/
- run:
name: Run unit tests and lint
command: ./gradlew testDebug lintDebug
- store_test_results:
path: app/build/test-results/testDebugUnitTest/
- save_cache:
paths:
- ~/.gradle
key: jars-{{ checksum "build.gradle" }}-{{ checksum "app/build.gradle" }}
espresso_tests:
<<: *defaults
steps:
- checkout
- restore_cache:
key: apks-{{ .Revision }}
# Setup Google Cloud SDK to use for Firebase Test Lab
- run: echo $GCLOUD_SERVICE_KEY | base64 --decode > ${HOME}/client-secret.json
- run: gcloud config set project audio-cast-radio
- run: gcloud auth activate-service-account circleci@audio-cast-radio.iam.gserviceaccount.com --key-file ${HOME}/client-secret.json
- run:
name: Run espresso tests
command: gcloud firebase test android run --app app/build/outputs/apk/debug/app-debug.apk --test app/build/outputs/apk/androidTest/debug/app-debug-androidTest.apk --results-dir ${CIRCLE_JOB}-${CIRCLE_BUILD_NUM}
- run:
name: Copy espresso artifacts from Google Cloud Platform bucket
command: |
mkdir espresso-results/
gsutil -m cp -r -U `gsutil ls gs://test-lab-jx4978yuch29c-yvvs849f9m01w/${CIRCLE_JOB}-${CIRCLE_BUILD_NUM}` espresso-results/
- store_artifacts:
path: espresso-results/
- run:
name: Copy espresso test results
command: |
mkdir espresso-test-reports/
find espresso-results/ -name '*.xml' -exec cp -prv '{}' 'espresso-test-reports/' ';'
- store_test_results:
path: espresso-test-reports/
workflows:
version: 2
workflow:
jobs:
- build_and_checks
- espresso_tests:
requires:
- build_and_checks