2020-03-21 19:48:03 +01:00
|
|
|
connected_check_task:
|
|
|
|
name: Run Android instrumented tests
|
|
|
|
env:
|
|
|
|
API_LEVEL: 23
|
|
|
|
TARGET: default
|
|
|
|
ARCH: x86
|
2020-03-31 16:03:02 +02:00
|
|
|
CC_TEST_REPORTER_ID: ENCRYPTED[!b71004b17b92e8fb7a3fecc3e2a9cc28c4e5f07f55e2f20cdfc641c57487cd21c7df6e7930318f8d87bc4675e63b260d!]
|
2020-03-21 19:48:03 +01:00
|
|
|
container:
|
|
|
|
image: reactivecircus/android-emulator-23:latest
|
|
|
|
kvm: true
|
|
|
|
cpu: 8
|
2020-03-24 22:42:22 +01:00
|
|
|
memory: 16G
|
2020-03-21 19:48:03 +01:00
|
|
|
create_device_script:
|
|
|
|
echo no | avdmanager create avd --force --name "api-${API_LEVEL}" --abi "${TARGET}/${ARCH}" --package "system-images;android-${API_LEVEL};${TARGET};${ARCH}"
|
|
|
|
start_emulator_background_script:
|
|
|
|
$ANDROID_HOME/emulator/emulator -avd "api-${API_LEVEL}" -no-window -gpu swiftshader_indirect -no-snapshot -noaudio -no-boot-anim -camera-back none
|
|
|
|
wait_for_emulator_script:
|
2020-03-24 23:02:58 +01:00
|
|
|
- chmod +x android-wait-for-emulator.sh
|
2020-03-24 22:56:52 +01:00
|
|
|
- ./android-wait-for-emulator.sh
|
2020-03-21 19:48:03 +01:00
|
|
|
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
|
|
|
|
run_instrumented_tests_script:
|
|
|
|
./gradlew build connectedCheck jacocoTestReport
|
|
|
|
report_codeclimate_script:
|
|
|
|
# Report test coverage to Code Climate
|
|
|
|
- export JACOCO_SOURCE_PATH=app/src/main/java/
|
|
|
|
- ./cc-test-reporter format-coverage ./app/build/reports/jacoco/jacocoTestReport/jacocoTestReport.xml --input-type jacoco
|
|
|
|
- ./cc-test-reporter upload-coverage
|