cook4me/android

View on GitHub
.cirrus.yml

Summary

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

env:
  CC_TEST_REPORTER_ID: ENCRYPTED[810adb57cea27867b3a3df646f8405adbd768b4c0a8815d6312e07b81f863cde28c534a478272a06653444c79565e6f5]
  GITHUB_USERNAME: ENCRYPTED[c7138816e29ae53840782306195152fb0cee26a33c7f7c704e7119e9848a9bc4a271920b5e11e98a38a232ccf4a2d9ec]
  GITHUB_TOKEN: ENCRYPTED[21f03c84e00674f5db068f1429c3df027d0f706895ffaa9f329b17205a4282c6d481707da09fa1d2fc82e42de113665a]
  MAPS_API_KEY: ENCRYPTED[dcc04cf3d0c1d37bbd61632cfeb15c95cab1f7043bec4a373ce661a55c36fb63879426d75425bef7354d2821c345b58a]
  GOOGLE_SERVICES: ENCRYPTED[f1e9a8713bb266b8df59125b59ba22ec996807e701bd80af0dd46123496e66efed08d2de3611f9c1b939f2720982b126]
  CHAT_API_KEY: ENCRYPTED[510bf42425feda5a0741a7c760f98ff27a31c86e6a1c7b426d1dd419bd1a276332fef0b93f9a0d2fa4c726eee8a9768b]
check_android_task:
  name: Run Android tests
  install_emulator_script:
    sdkmanager --install "system-images;android-30;google_apis_playstore;x86_64"
  create_avd_script: echo no | avdmanager create avd --force
      --name emulator
      --package "system-images;android-30;google_apis_playstore;x86_64"
  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
  prepare_environment_script:
    sh ./.cirrus/populate_properties.sh
  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 './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
    androidtest_error_logs_artifacts:
      path: "./app/build/reports/androidTests/connected/index.html"
      type: text/html