CoronaTeam/CoronaGame

View on GitHub
.cirrus.yml

Summary

Maintainability
Test Coverage
connected_check_task:
  name: Run Android instrumented tests
  use_compute_credits: 'true'
  env:
    API_LEVEL: 24
    TARGET: default
    ARCH: x86
    CC_TEST_REPORTER_ID: ENCRYPTED[!0f2d5d39b5800bbd203da84523ed7d103ed42fc5ca436e9f8a5f61a775437d37b430ad22311bbaacfdd6032ffd19a7d9!]
  container:
    image: reactivecircus/android-emulator-24:latest
    kvm: true
    cpu: 4
    memory: 8G
  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:
    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
  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