Skip to content

Instantly share code, notes, and snippets.

@chrisleversuch
Created February 23, 2018 09:32
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save chrisleversuch/5acfc655bdfe87be1d0255a021e2f0c2 to your computer and use it in GitHub Desktop.
Save chrisleversuch/5acfc655bdfe87be1d0255a021e2f0c2 to your computer and use it in GitHub Desktop.
CircleCI config for Firebase Test Lab
# Java Gradle CircleCI 2.0 configuration file
#
# Check https://circleci.com/docs/2.0/language-java/ for more details
#
version: 2
jobs:
build:
docker:
# specify the version you desire here
- image: circleci/android:api-26-alpha
# Specify service dependencies here if necessary
# CircleCI maintains a library of pre-built images
# documented at https://circleci.com/docs/2.0/circleci-images/
# - image: circleci/postgres:9.4
working_directory: ~/repo
environment:
# Customize the JVM maximum heap limit
JVM_OPTS: -Xmx3200m
steps:
- checkout
- restore_cache:
key: jars-{{ checksum "build.gradle" }}-{{ checksum "app/build.gradle" }}
- run:
name: Download Dependencies
command: ./gradlew androidDependencies
- save_cache:
paths:
- ~/.gradle
key: jars-{{ checksum "build.gradle" }}-{{ checksum "app/build.gradle" }}
- run:
name: Run Unit Tests
command: ./gradlew test
- store_artifacts:
path: app/build/reports
destination: reports
- store_test_results:
path: app/build/test-results
- run:
name: Assemble APKs
command: ./gradlew assembleAndroidTest assemble
- run:
name: Dump Google Cloud Credentials to file
command: echo ${GOOGLE_AUTH} > ${HOME}/gcp-key.json
- run: gcloud auth activate-service-account --key-file ${HOME}/gcp-key.json
- run: gcloud --quiet config set project ${GOOGLE_PROJECT_ID}
- run:
name: Configure environment
command: |
echo 'export APK_PATH=`find . -path "*.apk" ! -path "*unaligned.apk" ! -path "*Test*.apk" -print -quit`' >> $BASH_ENV
echo 'export TEST_APK_PATH=`find "." "-path" "*Test*.apk" -print -quit`' >> $BASH_ENV
- run:
name: Run UI Tests
command: gcloud firebase test android run --type instrumentation --app ${APK_PATH} --test ${TEST_APK_PATH} --device model=Nexus6P,version=27,locale=en,orientation=portrait --timeout 30m
no_output_timeout: 30m
@danielgomezrico
Copy link

Have you ever experienced this error?

Too long with no output (exceeded 10m0s)

@chrisleversuch
Copy link
Author

Yeah, circleci will kill a job if nothing is printed for a while (default 10 mins). This is why we've got 'no_output_timeout: 30m' in the last run step of this gist. See https://circleci.com/docs/2.0/configuration-reference/#run for more info

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment