-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
a67fc50
commit c2351fb
Showing
1 changed file
with
31 additions
and
43 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,49 +1,37 @@ | ||
# Use the latest 2.1 version of CircleCI pipeline process engine. | ||
# See: https://circleci.com/docs/2.0/configuration-reference | ||
# For a detailed guide to building and testing on Android, read the docs: | ||
# https://circleci.com/docs/2.0/language-android/ for more details. | ||
version: 2.1 | ||
|
||
# Orbs are reusable packages of CircleCI configuration that you may share across projects, enabling you to create encapsulated, parameterized commands, jobs, and executors that can be used across multiple projects. | ||
# See: https://circleci.com/docs/2.0/orb-intro/ | ||
|
||
orbs: | ||
android: circleci/[email protected] | ||
|
||
# Define a job to be invoked later in a workflow. | ||
# See: https://circleci.com/docs/2.0/configuration-reference/#jobs | ||
android: circleci/[email protected] | ||
|
||
jobs: | ||
# Below is the definition of your job to build and test your app, you can rename and customize it as you want. | ||
build-and-test: | ||
# These next lines define the Android machine image executor. | ||
# See: https://circleci.com/docs/2.0/executor-types/ | ||
executor: | ||
name: android/android-machine | ||
|
||
# Add steps to the job | ||
# See: https://circleci.com/docs/2.0/configuration-reference/#steps | ||
build: | ||
executor: android/android | ||
steps: | ||
# Checkout the code as the first step. | ||
- checkout | ||
|
||
# The next step will run the unit tests | ||
- android/run-tests: | ||
test-command: ./gradlew lint testDebug --continue | ||
|
||
# Then start the emulator and run the Instrumentation tests! | ||
- android/start-emulator-and-run-tests: | ||
test-command: ./gradlew connectedDebugAndroidTest | ||
system-image: system-images;android-25;google_apis;x86 | ||
|
||
# And finally run the release build | ||
- restore_cache: | ||
key: android-orb-v1- | ||
- run: | ||
name: Assemble release build | ||
command: | | ||
./gradlew assembleRelease | ||
# Invoke jobs via workflows | ||
# See: https://circleci.com/docs/2.0/configuration-reference/#workflows | ||
workflows: | ||
sample: # This is the name of the workflow, feel free to change it to better match your workflow. | ||
# Inside the workflow, you define the jobs you want to run. | ||
jobs: | ||
- build-and-test | ||
name: Chmod permissions | ||
command: sudo chmod +x ./gradlew | ||
- run: | ||
name: Download Dependencies | ||
command: ./gradlew androidDependencies | ||
- save_cache: | ||
key: 'android-orb-v1-{{ epoch }}' | ||
paths: | ||
- ~/.android/build-cache | ||
- ~/.android/cache | ||
- run: | ||
name: Run Build | ||
command: ./gradlew build | ||
- store_artifacts: | ||
path: app/build/reports | ||
destination: reports | ||
- run: | ||
name: Run Tests | ||
command: ./gradlew lint test | ||
- store_test_results: | ||
path: app/build/test-results | ||
- store_artifacts: | ||
path: app/build/outputs/apk/debug/ | ||
destination: artifact-file |