From 4c1c3e38c0929e4e1d0d155154fb424d305ac496 Mon Sep 17 00:00:00 2001 From: hmalik144 Date: Thu, 5 Dec 2019 23:56:38 +1100 Subject: [PATCH] circleCi integration initiation --- .circleci/config.yml | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) create mode 100644 .circleci/config.yml diff --git a/.circleci/config.yml b/.circleci/config.yml new file mode 100644 index 0000000..6cda02a --- /dev/null +++ b/.circleci/config.yml @@ -0,0 +1,31 @@ +version: 2 +jobs: + test: + docker: + - image: circleci/android:api-28-alpha # gcloud is baked into this image + steps: + - run: + name: Build debug APK and release APK + command: | + ./gradlew :app:assembleDebug + ./gradlew :app:assembleDebugAndroidTest + - run: + name: Store Google Service Account + command: echo $GCLOUD_SERVICE_KEY > ${HOME}/gcloud-service-key.json + - run: + 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 \ No newline at end of file