From 73deff2222444f96a3ce00ed443e009be5232937 Mon Sep 17 00:00:00 2001 From: hmalik144 Date: Fri, 6 Dec 2019 00:01:07 +1100 Subject: [PATCH] circleCi integration updated --- .circleci/config.yml | 50 +++++++++++++++++++++++--------------------- 1 file changed, 26 insertions(+), 24 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 6cda02a..832ef9e 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -1,31 +1,33 @@ version: 2 jobs: - test: + build: + working_directory: ~/code docker: - - image: circleci/android:api-28-alpha # gcloud is baked into this image + - image: circleci/android:api-28-alpha + environment: + JVM_OPTS: -Xmx3200m steps: + - checkout + - restore_cache: + key: jars-{{ checksum "build.gradle" }}-{{ checksum "app/build.gradle" }} - run: - name: Build debug APK and release APK - command: | - ./gradlew :app:assembleDebug - ./gradlew :app:assembleDebugAndroidTest + name: Chmod permissions #if permission for Gradlew Dependencies fail, use this. + command: sudo chmod +x ./gradlew - run: - name: Store Google Service Account - command: echo $GCLOUD_SERVICE_KEY > ${HOME}/gcloud-service-key.json + name: Download Dependencies + command: ./gradlew androidDependencies + - save_cache: + paths: + - ~/.gradle + key: jars-{{ checksum "build.gradle" }}-{{ checksum "app/build.gradle" }} - 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 + # name: Run UnitTest + # command: ./gradlew ExampleInstrumentedTest + name: Run Tests + command: ./gradlew lint test + - store_artifacts: # for display in Artifacts: https://circleci.com/docs/2.0/artifacts/ + path: app/build/reports + destination: reports + - store_test_results: # for display in Test Summary: https://circleci.com/docs/2.0/collect-test-data/ + path: app/build/test-results + # See https://circleci.com/docs/2.0/deployment-integrations/ for deploy examples \ No newline at end of file