HumanLearning2021/HumanLearningApp

View on GitHub
.cirrus.yml

Summary

Maintainability
Test Coverage
check_android_task:
  name: Run Android tests
  env:
    API_LEVEL: 24
    TARGET: google_apis
    ARCH: x86
    CC_TEST_REPORTER_ID: ENCRYPTED[de4bf2175d1caa3fa7967460887811e99b14819ed833ce2783d6f6ff1c7d6dbb65bf29f3468f978306f753912e27e991]
    KEYSTORE_PASSPHRASE: ENCRYPTED[8cf2af5735b5466ae45825e30c356f5aa95a363f57e5fc90529d27d27e71ce0f18bb995bf3a4f2cf801cd71b3fa552f0]
    FIREBASE_TOKEN: ENCRYPTED[574693c17b095dbdb775360edeb99be34637b5c81e442d10d28eee5da5866d941186114fdfc14f7b0ddd9e897c4dc590]
  container:
    dockerfile: Dockerfile
    kvm: true
    cpu: 8
    memory: 10G
  start_firebase_emulator_background_script:
    firebase emulators:start --token ${FIREBASE_TOKEN} --import ./firestore_state_linux
  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 emulated
  deploy_keystore_properties_script: |
    cat >keystore.properties << END
    storePassword=$KEYSTORE_PASSPHRASE
    keyPassword=$KEYSTORE_PASSPHRASE
    END 
  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:
    android-lint_artifacts:
      path: ./app/build/reports/lint-results-debug.xml
      type: text/xml
      format: android-lint