.travis.yml
language: android
android:
components:
# The BuildTools version used by your project
- build-tools-28.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
before_script:
# 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
- adb shell input keyevent 82
# This should be in the `before_script` entry
# 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
script:
- ./gradlew build connectedCheck jacocoTestReport -i
after_script:
# Report test coverage to Code Climate
- cp app/build/generated/source/apt/debug/ch/epfl/sweng/favors/BR.java app/src/main/java/ch/epfl/sweng/favors/
- mkdir -p ./app/src/main/java/com/android/databinding/library/baseAdapters/
- cp app/build/generated/source/apt/debug/com/android/databinding/library/baseAdapters/BR.java app/src/main/java/com/android/databinding/library/baseAdapters/
- mkdir -p app/src/main/java/ch/epfl/sweng/favors/databinding
- cp -R app/build/generated/source/apt/debug/ch/epfl/sweng/favors/databinding/. app/src/main/java/ch/epfl/sweng/favors/databinding
- 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