This repository has been archived by the owner on Jul 18, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 7
/
Copy pathcircle.yml
51 lines (42 loc) · 2.94 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
# Many CI systems start with the intention of having convention over configuration, and trying to make things look nice and easy to get started. This can fall apart pretty quickly, if the convention isn't flexible enough or isn't keeping up with the latest developments. That is what happened here, and this CI configuration is gross.
# There are a number of custom things happening in this script that deviate from CircleCI's Android documentation. The reasons are 1. performance and 2. portability between this and some other CI systems we use for other projects.
# To speed up builds, our own versions of gcloud and the Android SDK are downloaded to a separate directory and cached. This saves about 5 minutes per build. Updating the preinstalled components is a pain, because we don't want to cache directories that might get overwritten with a new container image later.
# Note: when forking this repo, environment variables GCLOUD_SERVICE_KEY_BASE_64, GCLOUD_PROJECT_ID, and GCLOUD_DEFAULT_BUCKET need to be defined for CI builds to work.
# Note that this doesn't work to prefix the path. CircleCI adds more crap to the beginning of PATH after we try to define it, including an old version of glcoud. So each many invocations are prefixed with an override of PATH.
# machine:
# environment:
# PATH: "/home/ubuntu/mybin/gcloud/bin:${PATH}"
general:
branches:
ignore:
- gh-pages
machine:
java:
version: oraclejdk8
environment:
ANDROID_HOME: "/home/ubuntu/mybin/android-sdk-linux"
dependencies:
pre:
- mkdir -p ~/flags
- mkdir -p ~/mybin
- ./tools/ci/android-sdk-setup.sh ${ANDROID_HOME} 25.2.5 ~/flags/android-sdk "tools" "platforms;android-25" "build-tools;25.0.3" "platform-tools" "docs"
- PATH="/home/ubuntu/mybin/gcloud/bin:${PATH}" && ./tools/ci/google-cloud-test-lab-setup.sh /home/ubuntu/mybin/gcloud 152.0.0 ~/flags/gcloud-setup ${GCLOUD_SERVICE_KEY_BASE_64} ${GCLOUD_PROJECT_ID}
- sudo apt-get update; sudo apt-get install parallel
override:
- ./gradlew resolveAllDependencies
cache_directories:
- ".gradle"
- "/home/ubuntu/flags"
- "/home/ubuntu/mybin"
- "/home/ubuntu/.android"
test:
override:
- ./gradlew assemble assembleDebugAndroidTest lint findbugs releaseJavadoc dependencyUpdates --profile
- PATH="/home/ubuntu/mybin/gcloud/bin:${PATH}" && parallel tools/ci/firebase-test-lab-test-module.sh pluginClientSdkLib ${GCLOUD_DEFAULT_BUCKET} {1} ':::' "model=Nexus4,version=19,orientation=portrait" "model=NexusLowRes,version=25,orientation=portrait"
# Convert the coverage.ec files into readable reports
- ./gradlew createDebugCoverageReport -x connectedDebugAndroidTest
- cp -r build/reports/profile $CIRCLE_ARTIFACTS
- cp -r build/dependencyUpdates $CIRCLE_ARTIFACTS
- cp -r pluginClientSdkLib/build/outputs $CIRCLE_ARTIFACTS
- cp -r pluginClientSdkLib/build/reports $CIRCLE_ARTIFACTS
- cp -r pluginClientSdkLib/build/outputs/androidTest-results/* $CIRCLE_TEST_REPORTS