forked from google/flexbox-layout
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcircle.yml
46 lines (43 loc) · 2.55 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
machine:
environment:
CLOUDSDK_CORE_DISABLE_PROMPTS: 1
CLOUDSDK_PYTHON_SITEPACKAGES: 1
CLOUDSDK_INSTALL_DIR: /tmp
java:
version: oraclejdk8
dependencies:
pre:
- echo y | android update sdk --no-ui --all --filter "build-tools-23.0.3"
# For some reasons, there is an issue with the pre-installed gcloud that
# PyOpenSSL is not available when trying to activate the service account.
# Re-installing the gcloud worked as a workaround.
# See https://discuss.circleci.com/t/deployment-to-appengine-fails-pyopenssl-not-available/2154
# Suppress the gcloud installation 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.
- >
if [ -n "$GCLOUD_SERVICE_KEY" ]; then sudo apt-get remove python-virtualenv python-openssl python3-openssl ;
sudo apt-get update;
sudo apt-get install python-openssl python3-openssl ;
sudo rm -rf /opt/google-cloud-sdk/ ;
curl https://sdk.cloud.google.com | bash ;
source ~/.bashrc ;
fi
cache_directories:
- ~/.android
override:
- ./gradlew dependencies
post:
- >
if [ -n "$GCLOUD_SERVICE_KEY" ]; then echo ${GCLOUD_SERVICE_KEY} | base64 --decode > ${HOME}/client-secret.json ;
/tmp/google-cloud-sdk/bin/gcloud config set project ${GCLOUD_PROJECT} ;
/tmp/google-cloud-sdk/bin/gcloud --quiet components update ;
/tmp/google-cloud-sdk/bin/gcloud --quiet components install beta ;
/tmp/google-cloud-sdk/bin/gcloud auth activate-service-account ${GCLOUD_SERVICE_ACCOUNT} --key-file ${HOME}/client-secret.json ;
fi
test:
override:
- ./gradlew build assembleAndroidTest
- if [ -n "$GCLOUD_SERVICE_KEY" ]; then echo "y" | /tmp/google-cloud-sdk/bin/gcloud beta test android run --type instrumentation --app app/build/outputs/apk/app-debug.apk --test flexbox/build/outputs/apk/flexbox-debug-androidTest-unaligned.apk --device-ids hammerhead,flounder,condor_umts --os-version-ids 19,21,23 --locales en,ar_SS --orientations portrait,landscape --results-bucket ${GCLOUD_TEST_BUCKET_LIBRARY} --timeout 180s ; fi
post:
- if [ -n "$GCLOUD_SERVICE_KEY" ]; then /tmp/google-cloud-sdk/bin/gsutil -m cp -r -U `/tmp/google-cloud-sdk/bin/gsutil ls gs://${GCLOUD_TEST_BUCKET_LIBRARY} | tail -1` $CIRCLE_ARTIFACTS/ | true ; fi