0
0
mirror of https://github.com/ankidroid/Anki-Android.git synced 2024-09-20 12:02:16 +02:00
Anki-Android/.travis.yml
Mike Hardy 468676f3b9 Disable API24 in Travis, it has become unreliable
This appears to be a progressive disease related to code growth
or something, unsure. Bears examination later but in the meantime
CI should never flake
2018-12-04 20:27:59 -05:00

91 lines
4.1 KiB
YAML

language: android
jdk:
- oraclejdk8
env:
global:
- ADB_INSTALL_TIMEOUT=8
- ABI=armeabi-v7a
- EMU_FLAVOR=default # use google_apis flavor if no default flavor emulator
# PATH order is incredibly important. e.g. the 'emulator' script exists in more than one place!
- ANDROID_HOME=/usr/local/android-sdk
- TOOLS=${ANDROID_HOME}/tools
- PATH=${ANDROID_HOME}:${ANDROID_HOME}/emulator:${TOOLS}:${TOOLS}/bin:${ANDROID_HOME}/platform-tools:${PATH}
matrix:
#- API=15 # fails consistently but can run locally
- API=16 AUDIO=-no-audio
- API=17
#- API=18 # API18 has started being flaky
# API 20 doesn't have an emulator
- API=21
- API=22
#- API=23 EMU_FLAVOR=google_apis # fails consistently but can run local
#- API=24 #API24 flaky now as well (after API18 started flaking). It is a progressive disease with more tests I think
# API16 and API19 are the fastest APIs, Travis runs 5 at a time and we have 6, this is the fastest way to do all 6 APIs
- API=19
#- API=25 EMU_FLAVOR=google_apis # fails consistently but can run local
# API >= 26 don't have arm emulators, and Travis doesn't support x86
# All failing emulators are disabled now, but leaving this in for future work enabling them
#matrix:
# fast_finish: true # We can report success without waiting for these
# allow_failures:
# - env: API=15 # sometimes emulator hangs, sometimes not - possibly fixable
# - env: API=23 EMU_FLAVOR=google_apis # has permission errors
# - env: API=25 EMU_FLAVOR=google_apis # has permission errors, emulator timeout
jobs:
include:
# The test stage is implicit, we only need to define a post-test stage for codacy finalization
- stage: finalize_coverage
env: FINALIZE_COVERAGE=TRUE API=NONE
install: skip
script: echo finalize codacy coverage uploads
android:
components:
# installing tools to start, then use `sdkmanager` below to get the rest
- tools
licenses:
- 'android-sdk-preview-license-.+'
- 'android-sdk-license-.+'
- 'google-gdk-license-.+'
# Emulator Management: Create, Start and Wait
install:
- echo 'count=0' > /home/travis/.android/repositories.cfg # Avoid harmless sdkmanager warning
- echo y | sdkmanager "platform-tools" >/dev/null
- echo y | sdkmanager "tools" >/dev/null # A second time per Travis docs, gets latest versions
- echo y | sdkmanager "build-tools;28.0.3" >/dev/null # Implicit gradle dependency - gradle drives changes
- echo y | sdkmanager "platforms;android-$API" >/dev/null # We need the API of the emulator we will run
- echo y | sdkmanager "platforms;android-28" >/dev/null # We need the API of the current compileSdkVersion from gradle.properties
- echo y | sdkmanager "extras;android;m2repository" >/dev/null
- echo y | sdkmanager "system-images;android-$API;$EMU_FLAVOR;$ABI" >/dev/null # install our emulator
- echo no | avdmanager create avd --force -n test -k "system-images;android-$API;$EMU_FLAVOR;$ABI" -c 10M
- emulator -avd test -engine classic -no-window $AUDIO -camera-back none -camera-front none -selinux permissive -qemu -m 1536 &
- android-wait-for-emulator
- adb shell input keyevent 82 &
script:
- ./gradlew jacocoTestReport -Pandroid.testInstrumentationRunnerArguments.notPackage=com.ichi2.anki.uitests
# Codacy integration, partials for all APIs, then an optional finalize
after_success:
- wget --progress=dot:giga -O ~/codacy-coverage-reporter-assembly-latest.jar https://oss.sonatype.org/service/local/repositories/releases/content/com/codacy/codacy-coverage-reporter/4.0.2/codacy-coverage-reporter-4.0.2-assembly.jar
- if [[ ( "$API" != "NONE" ) ]]; then java -jar ~/codacy-coverage-reporter-assembly-latest.jar report -l Java -r AnkiDroid/build/reports/jacoco/jacocoTestReport/jacocoTestReport.xml --partial; fi
- if [[ ( "$FINALIZE_COVERAGE" == "TRUE" ) ]]; then java -jar ~/codacy-coverage-reporter-assembly-latest.jar final; fi
before_cache:
- rm -f $HOME/.gradle/caches/modules-2/modules-2.lock
cache:
directories:
- $HOME/.gradle/caches/
- $HOME/.gradle/wrapper/
notifications:
email:
- flerda+ankidroid-continuous@gmail.com