guess-It-SDP/guessIt

View on GitHub
.cirrus.yml

Summary

Maintainability
Test Coverage
env:
  CC_TEST_REPORTER_ID: ENCRYPTED[!0ba144f632c9075a8e56e45e61b33629f9b79381146f8a974d7a204202808b382e270c5b1a1b5ea61a008c2fc1b4486b!]
  FIREBASE_TOKEN: ENCRYPTED[3a878eba1b0934e1a4b42f01016027da09652a735c3706754e3ee1db32cc4f550ea4187397fff1513ecfbc53c67726d2]
  

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

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
  download_firebase_emulator_script: |
    curl -Lo ./firebase_bin https://firebase.tools/bin/linux/latest
  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
  
  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: |
    chmod +x firebase_bin
    ./firebase_bin emulators:exec --project sdp-guess-it './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