0
0
mirror of https://github.com/ankidroid/Anki-Android.git synced 2024-09-20 12:02:16 +02:00
Anki-Android/.travis.yml
Joshua Ford 7ab8473130 Build API 24 with Oracle JDK 11
This adds support in Travis to build API 24 with Oracle JDK 11. However,
at the current time, only Oracle JDK 8 is in active use on the project.
As such, we allow JDK 11 builds to fail without affecting the build
status for the project overall.

In Travis, "jobs" is an alias for "matrix". This is not very clear, and
is mentioned casually and off-handedly in their documentation. To help
clean up the config file, we also remove the old "matrix" block,
squishing it down into the "jobs" block.
2019-06-14 16:39:50 -05:00

94 lines
3.8 KiB
YAML

language: android
dist: trusty
jdk:
- oraclejdk8
env:
global:
- ADB_INSTALL_TIMEOUT=8
- ABI=x86_64
- 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 # only runs locally. Create+Start once from AndroidStudio to init sdcard. Then only from command-line w/-engine classic
- API=16 ABI=armeabi-v7a AUDIO=-no-audio
- API=17 ABI=armeabi-v7a
- API=18 ABI=armeabi-v7a # API18 has started being flaky
#- API=19 ABI=armeabi-v7a # Fails: kernel/emulator mismatch, and emulator-29+ doesn't support "-engine classic" to fix
# API 20 was Android Wear only
- API=21
- API=22
- API=23
- API=24
- API=25
#- API=26 ABI=x86_64 # Fails with unrecognized tests? orchestrator change or something?
#- API=27 # Same failure as below for API28, but less frequently
#- API=28 # Fails on adb 2 second getprop timeout and get API getprop takes 2.2s, so emulator boots but adb won't install on unknown API
#- API=Q # Fails at some point on emulator startup or detecting startup complete
jobs:
fast_finish: true # We can report success without waiting for jobs that we
# allow / expect to fail.
include:
- jdk: oraclejdk11
env: API=24
# 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
allow_failures:
- jdk: oraclejdk11
# API=28/Q are probably fixable but we don't need allow_failures to be on
# in master to work through them.
#- env: API=28
#- env: API=Q
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 --channel=4 "emulator" >/dev/null # Use canary channel to get emulator 29.x for x86_64 image support
- 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 -verbose -avd test -no-accel -no-snapshot -no-window $AUDIO -camera-back none -camera-front none -selinux permissive -qemu -m 2048 &
- android-wait-for-emulator
- adb shell input keyevent 82 &
script:
- ./gradlew jacocoTestReport # This produces an error while doing the API getprop on API 28...
after_success:
- if [ "$TRAVIS_PULL_REQUEST" = "false" ]; then bash tools/upload-codacy-report.sh; 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