Skip to content

Commit 1874afa

Browse files
authored
Migrate CircleCI 2.0 (#385)
Migrate to CircleCI 2.0
1 parent 4580bf2 commit 1874afa

File tree

2 files changed

+43
-43
lines changed

2 files changed

+43
-43
lines changed

.circleci/config.yml

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
version: 2
2+
jobs:
3+
build:
4+
working_directory: ~/code
5+
docker:
6+
- image: circleci/android:api-27-alpha
7+
environment:
8+
JVM_OPTS: -Xmx3200m
9+
MAX_RETRY: 4
10+
steps:
11+
- checkout
12+
- restore_cache:
13+
key: jars-{{ checksum "build.gradle" }}-{{ checksum "flexbox/build.gradle" }}
14+
- run:
15+
name: Download Dependencies
16+
command: ./gradlew androidDependencies
17+
- run:
18+
name: Set up gcloud service key
19+
command: |
20+
if [ -n "$GCLOUD_SERVICE_KEY" ]; then echo ${GCLOUD_SERVICE_KEY} | base64 --decode > ${HOME}/client-secret.json ;
21+
gcloud config set project ${GCLOUD_PROJECT} ;
22+
gcloud auth activate-service-account ${GCLOUD_SERVICE_ACCOUNT} --key-file ${HOME}/client-secret.json ;
23+
fi
24+
- save_cache:
25+
paths:
26+
- ~/.gradle
27+
key: jars-{{ checksum "build.gradle" }}-{{ checksum "flexbox/build.gradle" }}
28+
- run:
29+
name: Build apks
30+
command: ./gradlew build assembleAndroidTest
31+
- run:
32+
name: Run Firebase Test Lab
33+
command: |
34+
if [ -n "$GCLOUD_SERVICE_KEY" ]; then set +e ;
35+
counter=0 ;
36+
result=1 ;
37+
while [ $result != 0 -a $counter -lt $MAX_RETRY ]; do
38+
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,sailfish --os-version-ids 19,21,23,24,25,26 --locales en --orientations portrait,landscape --results-bucket ${GCLOUD_TEST_BUCKET_LIBRARY} --timeout 180s ;
39+
result=$? ;
40+
let counter=counter+1 ;
41+
done
42+
exit $result ;
43+
fi

circle.yml

Lines changed: 0 additions & 43 deletions
This file was deleted.

0 commit comments

Comments
 (0)