Drone3D-Team/Drone3D

View on GitHub
.cirrus.yml

Summary

Maintainability
Test Coverage
check_android_task:
  name: Run Android tests
  env:
    API_LEVEL: 29
    TARGET: default
    ARCH: x86
    CC_TEST_REPORTER_ID: ENCRYPTED[b15049ff5402eb9236bc84355e1c8e6dc7cb8f9a5380c455cc1c9a645563c754a997471354711d782482e5c23aa3c95e]
    KEYS_MAPBOX: ENCRYPTED[0a6b836571de5fdaf75c93bcace075e6198adb12c546265d7a22e640ffcbc2d1fe8b07735d655f1dae6de34d5111bca7]
    KEYS_OPENWEATHER: ENCRYPTED[!8ed407a3fbf57a07f13f381fc63300d148b73b3ef0cf2724987b3752aff42c9d0a4d06cd1ee798f8ae2596f6b2b1fd7e!]
  container:
    image: reactivecircus/android-emulator-$API_LEVEL:latest
    kvm: true
    cpu: 8
    memory: 10G
  create_device_script: echo no | avdmanager create avd --force --name test --abi "$TARGET/$ARCH" --package "system-images;android-$API_LEVEL;$TARGET;$ARCH"
  start_emulator_background_script: $ANDROID_SDK_ROOT/emulator/emulator -avd test -no-window -gpu swiftshader_indirect -no-snapshot -no-audio -no-boot-anim -camera-back none
  import_mapbox_secret_key_script: echo $KEYS_MAPBOX >> ./gradle.properties
  import_openweather_secret_key_script: echo $KEYS_OPENWEATHER >> ./app/src/main/res/values/secrets.xml
  build_script: |
    chmod +x gradlew
    ./gradlew assembleDebugAndroidTest
  wait_for_emulator_script: |
    adb wait-for-device
    adb shell 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
  check_script: ./gradlew check connectedCheck
  report_codeclimate_script: |
    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
  lint_script: ./gradlew lintDebug
  always:
    reports_artifacts:
      path: ./app/build/reports/**
    android-lint_artifacts:
      path: ./app/build/reports/lint-results-debug.xml
      type: text/xml
      format: android-lint