Ph0tonic/SDP_Projet

View on GitHub
.cirrus.yml

Summary

Maintainability
Test Coverage
connected_check_task:
  name: Run Android instrumented tests
  env:
    API_LEVEL: 28
    TARGET: default
    ARCH: x86
    CC_TEST_REPORTER_ID: ENCRYPTED[437c27bfb64040626acf7f420701b9391f80e46bcdc9b1a11f5a8a8ed35ee5f66576f7289bb71ff7e18c822219e8a620]
    GRADLE_OPTS: -Dkotlin.compiler.execution.strategy=in-process
  container:
    image: reactivecircus/android-emulator-${API_LEVEL}:latest
    kvm: true
    cpu: 8
    memory: 24G
  create_mavsdk_server_script:
    - curl -L https://github.com/mavlink/MAVSDK/releases/download/v0.26.0/mavsdk_server_manylinux2010-x64 > ./mavsdk_server_manylinux1-x64
    - chmod +x ./mavsdk_server_manylinux1-x64
    - ./mavsdk_server_manylinux1-x64 -p 50051 &
  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_SDK_ROOT/emulator/emulator -avd "api-${API_LEVEL}" -no-window -gpu swiftshader_indirect -no-snapshot -noaudio -no-boot-anim -camera-back none
  assemble_instrumented_tests_script:
    ./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
  run_instrumented_tests_script:
    ./gradlew check 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

android_lint_task:
  container:
    image: cirrusci/android-sdk:30
    cpu: 4
    memory: 10G
  name: Android Lint
  lint_script: ./gradlew lintDebug
  always:
    android-lint_artifacts:
      path: ./app/build/reports/lint-results-debug.xml
      type: text/xml
      format: android-lint