circleCi integration updated

This commit is contained in:
2019-12-06 00:01:07 +11:00
parent 4c1c3e38c0
commit 73deff2222

View File

@@ -1,31 +1,33 @@
version: 2 version: 2
jobs: jobs:
test: build:
working_directory: ~/code
docker: docker:
- image: circleci/android:api-28-alpha # gcloud is baked into this image - image: circleci/android:api-28-alpha
environment:
JVM_OPTS: -Xmx3200m
steps: steps:
- checkout
- restore_cache:
key: jars-{{ checksum "build.gradle" }}-{{ checksum "app/build.gradle" }}
- run: - run:
name: Build debug APK and release APK name: Chmod permissions #if permission for Gradlew Dependencies fail, use this.
command: | command: sudo chmod +x ./gradlew
./gradlew :app:assembleDebug
./gradlew :app:assembleDebugAndroidTest
- run: - run:
name: Store Google Service Account name: Download Dependencies
command: echo $GCLOUD_SERVICE_KEY > ${HOME}/gcloud-service-key.json command: ./gradlew androidDependencies
- save_cache:
paths:
- ~/.gradle
key: jars-{{ checksum "build.gradle" }}-{{ checksum "app/build.gradle" }}
- run: - run:
name: Authorize gcloud and set config defaults # name: Run UnitTest
command: | # command: ./gradlew ExampleInstrumentedTest
sudo gcloud auth activate-service-account --key-file=${HOME}/gcloud-service-key.json name: Run Tests
sudo gcloud --quiet config set project ${GOOGLE_PROJECT_ID} command: ./gradlew lint test
- run: - store_artifacts: # for display in Artifacts: https://circleci.com/docs/2.0/artifacts/
name: Test with Firebase Test Lab path: app/build/reports
command: > destination: reports
sudo gcloud firebase test android run \ - store_test_results: # for display in Test Summary: https://circleci.com/docs/2.0/collect-test-data/
--app <local_server_path>/<app_apk>.apk \ path: app/build/test-results
--test <local_server_path>/<app_test_apk>.apk \ # See https://circleci.com/docs/2.0/deployment-integrations/ for deploy examples
--results-bucket cloud-test-${GOOGLE_PROJECT_ID}
- run:
name: Install gsutil dependency and copy test results data
command: |
sudo pip install -U crcmod
sudo gsutil -m cp -r -U `sudo gsutil ls gs://[BUCKET_NAME]/[OBJECT_NAME] | tail -1` ${CIRCLE_ARTIFACTS}/ | true