AndroidAPS/.circleci/config.yml
2023-12-12 10:36:20 +01:00

61 lines
2.3 KiB
YAML

# Use the latest 2.1 version of CircleCI pipeline process engine.
# See: https://circleci.com/docs/2.0/configuration-reference
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.
orbs:
android: circleci/android@2.3.0
codecov: codecov/codecov@3.3.0
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: https://circleci.com/docs/2.0/executor-types/
executor:
name: android/android-machine
resource-class: large
tag: 2023.10.1
steps:
- checkout
- android/change-java-version:
java-version: 17
- android/start-emulator-and-run-tests:
system-image: system-images;android-29;google_apis;x86
# Compile while the emulator starts to use the time.
post-emulator-launch-assemble-command: ./gradlew compileFullDebugUnitTestSources compileFullDebugAndroidTestSources
test-command: ./gradlew connectedFullDebugAndroidTest
- android/run-tests:
test-command: ./gradlew testFullDebugUnitTest
- android/run-tests:
test-command: ./gradlew --stacktrace jacocoAllDebugReport
- run:
name: Save test results
command: |
mkdir -p ~/test-results/junit/
find . -type f -regex ".*/build/outputs/androidTest-results/.*xml" -exec cp {} ~/test-results/junit/ \;
when: always
- store_test_results:
path: ~/test-results
- store_artifacts:
path: ~/test-results/junit
- codecov/upload:
file: './build/reports/jacoco/jacocoAllDebugReport/jacocoAllDebugReport.xml'
workflows:
# Below is the definition of your workflow.
# Inside the workflow, you provide the jobs you want to run, e.g this workflow runs the build-and-test job above.
# CircleCI will run this workflow on every commit.
# For more details on extending your workflow, see the configuration docs: https://circleci.com/docs/2.0/configuration-reference/#workflows
dotests:
jobs:
- build-and-test