.cirrus.yml
container:
image: cirrusci/android-sdk:30
cpu: 4
memory: 16G
kvm: true
env:
CC_TEST_REPORTER_ID: ENCRYPTED[6f94a7691e8d78e5ac1036722528fbf5e723b334ce612ae73d3a7b4933319182635e77870e01f6b1b04db9ec58be671d]
MAPS_API_KEY: ENCRYPTED[b187a2e09f6dbd94b420653932920bc150569d8712d2475af92db2dbc4fb65bb88757d6db32706b5211c21b9e300a28f]
check_android_task:
name: Run Android tests
install_emulator_script:
sdkmanager --install "system-images;android-30;google_apis;x86"
create_avd_script:
echo no | avdmanager create avd --force
--name emulator
--package "system-images;android-30;google_apis;x86"
start_avd_background_script:
$ANDROID_HOME/emulator/emulator
-avd emulator
-no-audio
-no-boot-anim
-gpu swiftshader_indirect
-no-snapshot
-no-window
-camera-back none
assemble_instrumented_tests_script: |
chmod +x gradlew
echo MAPS_API_KEY=$MAPS_API_KEY >> local.properties
./gradlew assembleDebugAndroidTest
wait_for_avd_script:
adb wait-for-device shell 'while [[ -z $(getprop sys.boot_completed) ]]; do sleep 3; done; input keyevent 82'
disable_animations_script: |
adb shell settings put global window_animation_scale 0.0
adb shell settings put global transition_animation_scale 0.0
adb shell settings put global animator_duration_scale 0.0
prepare_codeclimate_script: |
curl -L https://codeclimate.com/downloads/test-reporter/test-reporter-latest-linux-amd64 > ./cc-test-reporter
chmod +x ./cc-test-reporter
./cc-test-reporter before-build
screen_record_background_script:
for n in $(seq 1 20); do adb exec-out screenrecord --time-limit=180 --output-format=h264 - > $n.h264; done
check_script:
./gradlew check connectedCheck
report_codeclimate_script: |
ls ./app/build/reports/jacoco/jacocoTestReport
ls ./data/build/
ls ./data/build/reports/jacoco/jacocoTestReport
ls ./domain/build/
ls ./domain/build/reports/jacoco/jacocoTestReport
export JACOCO_SOURCE_PATH=app/src/main/java/
./cc-test-reporter format-coverage ./app/build/reports/jacoco/jacocoTestReport/jacocoTestReport.xml --input-type jacoco -o coverage.app.json
export JACOCO_SOURCE_PATH=data/src/main/java/
./cc-test-reporter format-coverage ./data/build/reports/jacoco/jacocoTestReport/jacocoTestReport.xml --input-type jacoco -o coverage.data.json
export JACOCO_SOURCE_PATH=domain/src/main/java/
./cc-test-reporter format-coverage ./domain/build/reports/jacoco/jacocoTestReport/jacocoTestReport.xml --input-type jacoco -o coverage.domain.json
./cc-test-reporter sum-coverage coverage.*.json -p 3 -o codeclimate.total.json
./cc-test-reporter upload-coverage -i codeclimate.total.json
lint_script:
./gradlew lintDebug
always:
wait_for_screenrecord_script: |
pkill -2 -x adb
sleep 2
screenrecord_artifacts:
path: "*.h264"
android_lint_artifacts:
path: "./**/build/reports/lint-results-debug.xml"
format: android-lint
test_artifacts:
path: "./**/build/test-results/**/*.xml"
format: junit
androidtest_artifacts:
path: "./**/build/outputs/**/*.xml"
format: junit