gyrodraw/GyroDraw

View on GitHub
.travis.yml

Summary

Maintainability
Test Coverage
language: android
android:
    components:
        # The BuildTools version used by your project
        - build-tools-27.0.3
        # The SDK version used to compile your project
        - android-28
        # The SDK version used by the system image
        - android-22
        # The system image, to run an emulator during the tests
        - sys-img-armeabi-v7a-android-22
    licenses:
        - 'android-sdk-preview-license-52d11cd2'
        - 'android-sdk-license-.+'
        - 'google-gdk-license-.+'
before_install:
  - yes | sdkmanager "platforms;android-28"
  ​- yes | sdkmanager --install "build-tools;28.0.3"​
before_script:
  - yes | sdkmanager "platforms;android-28"
  ​- yes | sdkmanager --install "build-tools;28.0.3"​
  # Set up Code Climate test reporter
  - 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
  # Emulator Management: Create, Start and Wait
  - echo no | android create avd --force -n test -t android-22 --abi armeabi-v7a
  - emulator -avd test -no-audio -no-window &
  - android-wait-for-emulator
  # Disable animations / transitions
  - 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
  - adb shell input keyevent 82
script:
  - chmod +x ./gradlew
  - travis_wait 60 ./gradlew connectedCheck jacocoTestReport
after_script:
  # Report test coverage to Code Climate
  - 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
after_failure:
  - if [ -f tests/tests.log ]; then cat tests/tests.log && sleep 10; fi
  - echo == End of test log ==