From 3e9d6a113801fdb6f75f68842218dbdfdb152b3a Mon Sep 17 00:00:00 2001 From: hmalik144 Date: Sat, 16 May 2020 14:36:59 +0100 Subject: [PATCH] yaml update --- .circleci/config.yml | 47 ++++++++++++++++++++++---------------------- 1 file changed, 24 insertions(+), 23 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index ec775ae..21d4c7a 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -1,30 +1,31 @@ version: 2 jobs: - build: - working_directory: ~/code + test: docker: - - image: circleci/android:api-29 - environment: - JVM_OPTS: -Xmx3200m + - image: circleci/android:api-29 # gcloud is baked into this image steps: - - checkout - - restore_cache: - key: jars-{{ checksum "build.gradle" }}-{{ checksum "app/build.gradle" }} - run: - name: chmod permissions - command: chmod +x ./gradlew + name: Build debug APK and release APK + command: | + ./gradlew :app:assembleDebug + ./gradlew :app:assembleDebugAndroidTest - run: - name: Download Dependencies - command: ./gradlew androidDependencies - - save_cache: - paths: - - ~/.gradle - key: jars-{{ checksum "build.gradle" }}-{{ checksum "app/build.gradle" }} + name: Store Google Service Account + command: echo $GCLOUD_SERVICE_KEY > ${HOME}/gcloud-service-key.json - run: - name: Run Tests - command: ./gradlew lint test - - store_artifacts: - path: app/build/reports - destination: reports - - store_test_results: - path: app/build/test-results + name: Authorize gcloud and set config defaults + command: | + sudo gcloud auth activate-service-account --key-file=${HOME}/gcloud-service-key.json + sudo gcloud --quiet config set project ${GOOGLE_PROJECT_ID} + - run: + name: Test with Firebase Test Lab + command: > + sudo gcloud firebase test android run \ + --app /.apk \ + --test /.apk \ + --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