forked from google/flexbox-layout
-
Notifications
You must be signed in to change notification settings - Fork 0
/
circle.yml
43 lines (40 loc) · 2.06 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
machine:
environment:
MAX_RETRY: 4
java:
version: oraclejdk8
dependencies:
pre:
- echo y | android update sdk --no-ui --all --filter "android-26,build-tools-26.0.0,tools,platform-tools,extra-android-m2repository"
cache_directories:
- ~/.android
override:
- ./gradlew dependencies
post:
- >
if [ -n "$GCLOUD_SERVICE_KEY" ]; then echo ${GCLOUD_SERVICE_KEY} | base64 --decode > ${HOME}/client-secret.json ;
gcloud config set project ${GCLOUD_PROJECT} ;
sudo /opt/google-cloud-sdk/bin/gcloud --quiet components update ;
sudo /opt/google-cloud-sdk/bin/gcloud --quiet components install beta ;
gcloud auth activate-service-account ${GCLOUD_SERVICE_ACCOUNT} --key-file ${HOME}/client-secret.json ;
fi
test:
override:
- ./gradlew build assembleAndroidTest
# Suppress running the instrumentation tests if the PR is from a forked repository
# because environment variables configured from the Circle CI UI are not
# visible for the PRs from forked repositories that are required to run the tests
# on the Firebase Test Lab.
- >
if [ -n "$GCLOUD_SERVICE_KEY" ]; then set +e ;
counter=0 ;
result=1 ;
while [ $result != 0 -a $counter -lt $MAX_RETRY ]; do
gcloud firebase test android run --type instrumentation --app demo-playground/build/outputs/apk/demo-playground-debug.apk --test flexbox/build/outputs/apk/flexbox-debug-androidTest.apk --device-ids hammerhead,herolte --os-version-ids 19,21,23,24,25 --locales en --orientations portrait,landscape --results-bucket ${GCLOUD_TEST_BUCKET_LIBRARY} --timeout 180s ;
result=$? ;
let counter=counter+1 ;
done
exit $result ;
fi
post:
- if [ -n "$GCLOUD_SERVICE_KEY" ]; then gsutil -m cp -r -U `gsutil ls gs://${GCLOUD_TEST_BUCKET_LIBRARY} | tail -1` $CIRCLE_ARTIFACTS/ | true ; fi