You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
82 lines
3.0 KiB
82 lines
3.0 KiB
language: android
|
|
|
|
branches:
|
|
only:
|
|
- master
|
|
- /^v\d+\.\d+\.\d+$/
|
|
- /^v\d+\.\d+\.\d+-beta\d+$/
|
|
- /^v\d+\.\d+\.\d+-rc\d+$/
|
|
|
|
sudo: false
|
|
|
|
jdk:
|
|
- oraclejdk8
|
|
|
|
env:
|
|
global:
|
|
- EMULATOR_ABI=x86_64 # works starting from emulator v29.
|
|
- EMULATOR_TAG=default # can be google_apis or google_apis_playstore
|
|
- PATH=$ANDROID_HOME:$ANDROID_HOME/emulator:$ANDROID_HOME/platform-tools:$PATH
|
|
matrix:
|
|
- EMULATOR_API=22
|
|
|
|
before_install:
|
|
# Perform actions that are common to all APIs in the matrix
|
|
- echo y | sdkmanager "platform-tools" >/dev/null
|
|
- echo y | sdkmanager "tools" >/dev/null
|
|
- echo y | sdkmanager "emulator" >/dev/null
|
|
- echo y | sdkmanager "build-tools;28.0.3" >/dev/null
|
|
- echo y | sdkmanager "platforms;android-28" >/dev/null
|
|
- sdkmanager --list || true # Check everything is updated
|
|
|
|
install:
|
|
# Install the emulator tools
|
|
- export EMULATOR="system-images;android-$EMULATOR_API;$EMULATOR_TAG;$EMULATOR_ABI"
|
|
- export EMULATOR_NAME="cameraview-$EMULATOR_API"
|
|
- echo y | sdkmanager "platforms;android-$EMULATOR_API" >/dev/null # Install sdk for the emulator
|
|
- echo y | sdkmanager "$EMULATOR" >/dev/null # Install system image
|
|
- sdkmanager --list || true # Check everything is updated
|
|
|
|
# Create and start the emulator
|
|
- echo no | avdmanager create avd --force --name $EMULATOR_NAME --package "$EMULATOR" # Create emulator virtual device
|
|
- emulator -avd $EMULATOR_NAME -no-snapshot -no-window -no-accel -no-snapshot -camera-back emulated -camera-front emulated -memory 2048 -writable-system & # Launch
|
|
|
|
# Wait for emulator
|
|
- adb wait-for-device # Wait for adb process
|
|
- adb remount # Mount as writable
|
|
- android-wait-for-emulator # Wait for emulator ready to interact
|
|
- adb shell settings put global window_animation_scale 0 & # Disable animations
|
|
- adb shell settings put global transition_animation_scale 0 & # Disable animations
|
|
- adb shell settings put global animator_duration_scale 0 & # Disable animations
|
|
- sleep 10 # Sleep 10 seconds just in case
|
|
- adb shell input keyevent 82 & # Dispatch unlock event
|
|
- sleep 10 # Sleep 10 seconds just in case
|
|
|
|
# Configure logs
|
|
# Would be great to use -v color to adb logcat but looks not supported on travis.
|
|
- adb logcat --help # See if this version supports color
|
|
- adb logcat -c # Clear logcat
|
|
- adb logcat Test:V TestRunner:V CameraView:I CameraEngine:I Camera1Engine:I Camera2Engine:I WorkerHandler:I THREAD_STATE:S *:E &
|
|
# - export LOGCAT_PID=$! # Save PID of the logcat process. Should kill later with kill $LOGCAT_PID
|
|
|
|
script:
|
|
- ./gradlew clean demo:assembleDebug cameraview:testDebugUnitTest cameraview:connectedCheck cameraview:mergedCoverageReport cameraview:javadoc
|
|
|
|
after_success:
|
|
- bash <(curl -s https://codecov.io/bash) -s "*/build/reports/mergedCoverageReport/"
|
|
|
|
before_cache:
|
|
- rm -f $HOME/.gradle/caches/modules-2/modules-2.lock
|
|
|
|
cache:
|
|
directories:
|
|
- $HOME/.gradle/caches/
|
|
- $HOME/.gradle/wrapper/
|
|
|
|
deploy:
|
|
provider: script
|
|
script: ./gradlew bintrayUpload
|
|
skip_cleanup: true
|
|
on:
|
|
branch: master
|
|
tags: true |