steroid-team/app

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[!18641e04e9f96b888ae7492d501c47ca3b0ec80e5b1190fcc460a297921e20fa51b7229309265625b4a4d1b1b1edee23!]
    GOOGLE_SERVICES_JSON_STRING: ENCRYPTED[f21b30ac9f69909dc734c787bd3d9487cc376218f824ff84ae5cbaffa8299a4e12a24d13dfcbae7b24b4788c330afcbf]
  container:
    image: reactivecircus/android-emulator-$API_LEVEL:latest
    kvm: true
    cpu: 2
    memory: 8G
  create_google_services_script:
    echo "$GOOGLE_SERVICES_JSON_STRING" > app/google-services.json
  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
  enable_location_script: |
    adb shell settings put secure location_mode 3
    ./gradlew installDebug
    adb shell appops set com.github.steroidteam.todolist android:mock_location allow
    adb shell pm grant com.github.steroidteam.todolist android.permission.ACCESS_FINE_LOCATION
    adb shell pm grant com.github.steroidteam.todolist android.permission.ACCESS_COARSE_LOCATION
  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
  code_format_script:
    ./gradlew spotlessCheck
  always:
    export_logcat_script:
      adb logcat -d > logcat.txt
    logcat_artifacts:
      path: "logcat.txt"
      type: text/plain
    test_artifacts:
      path: "./app/build/reports/androidTests/connected/flavors/debugAndroidTest/**.html"
      type: text/html
    junit-result_artifacts:
      path: "./app/build/test-results/**/*.xml"
      format: junit
      type: text/xml
    android-lint_artifacts:
      path: ./app/build/reports/lint-results-debug.xml
      type: text/xml
      format: android-lint