CultureQuestORG/SDP2023

View on GitHub
.cirrus.yml

Summary

Maintainability
Test Coverage
container:
  image: cirrusci/android-sdk:30
  cpu: 4
  memory: 16G
  kvm: true

env:
  CC_TEST_REPORTER_ID: ENCRYPTED[b0285782afbfb5a2a5ab6c2476f3cde563270cd3b2e77ee23f68f79a16c366578de8e9686dab40bdf8280984ec8c0d82]
  MAPS_API_KEY: ENCRYPTED[15d0b3d47c5ffc28ff82c57819f3920ced0a7587b55560da07df7f64c8caa3b02046ae2a5adf26ee96a371b93fc0bdb6]
  FIREBASE_TOKEN: ENCRYPTED[!d58bc887bf71556202bcf6bbbe5d44e823ad82944bb801057a61cd55fbc7604d0e1ffd1780a5159c4d98cbe2370b5f16!]
check_android_task:
  name: Run Android tests
  install_emulator_script:
    sdkmanager --install "system-images;android-30;google_apis;x86"
  create_avd_script:
    echo no | avdmanager create avd --force
    --name emulator
    --package "system-images;android-30;google_apis;x86"
  start_avd_background_script:
    $ANDROID_HOME/emulator/emulator
    -avd emulator
    -no-audio
    -no-boot-anim
    -gpu swiftshader_indirect
    -no-snapshot
    -no-window
    -camera-back none
  extract_api_script: |
    echo MAPS_API_KEY=$MAPS_API_KEY >> local.properties
  assemble_instrumented_tests_script: |
    chmod +x gradlew
    ./gradlew assembleDebugAndroidTest
  wait_for_avd_script:
    adb wait-for-device shell 'while [[ -z $(getprop sys.boot_completed) ]]; do sleep 3; done; 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
  install_firebase_CLI_script: |
    curl -sL https://firebase.tools | bash
  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
  screen_record_background_script:
    for n in $(seq 1 20); do adb exec-out screenrecord --time-limit=180 --output-format=h264 - > $n.h264; done
  check_script: |
    firebase emulators:exec --project culturequest './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:
    wait_for_screenrecord_script: |
      pkill -2 -x adb
      sleep 2
    screenrecord_artifacts:
      path: "*.h264"
    android_lint_artifacts:
      path: ./app/build/reports/lint-results-debug.xml
      format: android-lint
    test_artifacts:
      path: "./app/build/test-results/**/*.xml"
      format: junit
    androidtest_artifacts:
      path: "./app/build/outputs/**/*.xml"
      format: junit