whitewind664/sdp

View on GitHub
.cirrus.yml

Summary

Maintainability
Test Coverage
check_android_task:
  name: Run Android tests
  env:
    API_LEVEL: 30
    TARGET: google_apis
    ARCH: x86
    CC_TEST_REPORTER_ID: ENCRYPTED[bb53e0a57b9ba99fdad45d4fd39e8405a558650fe9bda03cb2989eb4c4d16489b5dac4cfddeb292e9419bb50e512be8e]
    MAPS_API_KEY: ENCRYPTED[fee85b28a1f6552ec9e8aabf2d192eeea2b69d216e47f4835475ee61e95fa4d9acad1998236f2efb3f05f35c5f4223ab]
  container:
    image: reactivecircus/android-emulator-$API_LEVEL:latest
    kvm: true
    cpu: 8
    memory: 10G
  firebase_emulator_cache:
    folder: "/root/.cache/firebase/emulators/"
  prepare_firebase_emulator_script: |
    chmod +x ./scripts/install_firebase_tools.sh
    ./scripts/install_firebase_tools.sh
  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
  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
  logcat_background_script:
      adb -e logcat *:W
  check_script: |
      chmod +x ./scripts/check.sh
      firebase emulators:exec "./scripts/check.sh"
  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:
    android-lint_artifacts:
      path: ./app/build/reports/lint-results-debug.xml
      type: text/xml
      format: android-lint