Last active
June 13, 2022 00:45
-
-
Save ValeryPonomarenko/2f86c2d4649bf92fea0c7a701691b7f6 to your computer and use it in GitHub Desktop.
Android CircleCI
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
version: 2 | |
defaults: &defaults | |
docker: | |
- image: circleci/android:api-28-alpha | |
environment: | |
JVM_OPTS: -Xmx3200m | |
jobs: | |
unit-tests: | |
<<: *defaults | |
steps: | |
- checkout | |
- restore_cache: | |
key: jars-{{ checksum "build.gradle" }}-{{ checksum "app/build.gradle" }} | |
- run: | |
name: Install fastlane | |
command: bundle install | |
- run: | |
name: Run the unit tests | |
command: bundle exec fastlane unit_tests | |
- store_artifacts: | |
path: app/build/reports | |
- save_cache: | |
paths: | |
- ~/.gradle | |
key: jars-{{ checksum "build.gradle" }}-{{ checksum "app/build.gradle" }} | |
instrumentation-tests: | |
<<: *defaults | |
steps: | |
- checkout | |
- restore_cache: | |
key: jars-{{ checksum "build.gradle" }}-{{ checksum "app/build.gradle" }} | |
- run: | |
name: Install fastlane | |
command: bundle install | |
- run: | |
name: Store service account | |
command: echo $GCLOUD_SERVICE_KEY > ${HOME}/gcloud-service-key.json | |
- run: | |
name: Authorize to gcloud | |
command: gcloud auth activate-service-account --key-file=${HOME}/gcloud-service-key.json --project=${GOOGLE_PROJECT_ID} | |
- run: | |
name: Run the instrumentation tests in Firebase test lab | |
command: bundle exec fastlane instrumentation_tests | |
- save_cache: | |
paths: | |
- ~/.gradle | |
key: jars-{{ checksum "build.gradle" }}-{{ checksum "app/build.gradle" }} | |
deploy-internal: | |
<<: *defaults | |
steps: | |
- checkout | |
- restore_cache: | |
key: jars-{{ checksum "build.gradle" }}-{{ checksum "app/build.gradle" }} | |
- run: | |
name: Install fastlane | |
command: bundle install | |
- run: | |
name: Store the google play key | |
command: echo $GOOGLE_PLAY_KEY > gplay_key.json | |
- run: | |
name: Init fastlane supply | |
command: bundle exec fastlane supply init | |
- run: | |
name: Download ci's data | |
command: ./ci/download_ci_data.sh | |
- run: | |
name: Deploy the app to the internal track | |
command: bundle exec fastlane deploy_internal | |
- save_cache: | |
paths: | |
- ~/.gradle | |
key: jars-{{ checksum "build.gradle" }}-{{ checksum "app/build.gradle" }} | |
workflows: | |
version: 2 | |
deploy-internal: | |
jobs: | |
- unit-tests | |
- instrumentation-tests | |
- hold: | |
type: approval | |
requires: | |
- unit-tests | |
- instrumentation-tests | |
- deploy-internal: | |
requires: | |
- hold |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment