mirror of
https://github.com/hmalik144/Android-developer-tech-test---POQ.git
synced 2025-12-10 03:05:24 +00:00
Update config.yml
This commit is contained in:
@@ -1,31 +1,35 @@
|
||||
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-27-alpha
|
||||
environment:
|
||||
- JVM_OPTS: -Xmx3200m
|
||||
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 <local_server_path>/<app_apk>.apk \
|
||||
--test <local_server_path>/<app_test_apk>.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
|
||||
- checkout
|
||||
- restore_cache:
|
||||
key: jars-{{ checksum "build.gradle" }}-{{ checksum "app/build.gradle" }}
|
||||
- run:
|
||||
name: Chmod permissions
|
||||
command: sudo chmod +x ./gradlew
|
||||
- run:
|
||||
name: Download Dependencies
|
||||
command: ./gradlew androidDependencies
|
||||
- save_cache:
|
||||
paths:
|
||||
- ~/.gradle
|
||||
key: jars-{{ checksum "build.gradle" }}-{{ checksum "app/build.gradle" }}
|
||||
- run:
|
||||
name: Run Tests
|
||||
command: ./gradlew lint test
|
||||
- store_artifacts:
|
||||
path: app/build/reports
|
||||
destination: reports
|
||||
- store_test_results:
|
||||
path: app/build/test-results
|
||||
workflows:
|
||||
version: 2
|
||||
workflow:
|
||||
jobs:
|
||||
- build
|
||||
|
||||
Reference in New Issue
Block a user