mirror of
https://github.com/kiwix/kiwix-android.git
synced 2025-08-03 10:46:53 -04:00
96 lines
2.5 KiB
YAML
96 lines
2.5 KiB
YAML
language: android
|
|
|
|
jdk: oraclejdk8
|
|
|
|
sudo: required
|
|
|
|
env:
|
|
global:
|
|
- ANDROID_TARGET=android-22
|
|
- ANDROID_ABI=armeabi-v7a
|
|
|
|
if: type != push OR tag IS present
|
|
|
|
before_install:
|
|
- openssl aes-256-cbc -K $encrypted_82adfa9c3806_key -iv $encrypted_82adfa9c3806_iv -in secrets.tar.enc -out secrets.tar -d
|
|
- tar xvf secrets.tar
|
|
|
|
install:
|
|
- pip install --user 'requests[security]'
|
|
- wget -r -nH -nd -np -R index.html* robots.txt* http://download.kiwix.org/dev/android/api/licenses/ -e robots=off -P $ANDROID_HOME/licenses || true
|
|
|
|
addons:
|
|
apt:
|
|
packages:
|
|
- lynx
|
|
|
|
before_cache:
|
|
- rm -f $HOME/.gradle/caches/modules-2/modules-2.lock
|
|
- rm -fr $HOME/.gradle/caches/*/plugin-resolution/
|
|
|
|
cache:
|
|
directories:
|
|
- "$HOME/.gradle/caches/"
|
|
- "$HOME/.gradle/wrapper/"
|
|
- "$HOME/.android/build-cache"
|
|
|
|
android:
|
|
components:
|
|
- tools
|
|
- platform-tools
|
|
- build-tools-28.0.3
|
|
- android-28
|
|
- extra-android-m2repository
|
|
- $ANDROID_TARGET
|
|
- sys-img-${ANDROID_ABI}-${ANDROID_TARGET}
|
|
|
|
licenses:
|
|
- ".+"
|
|
|
|
before_script:
|
|
- echo no | android create avd --force -n test -t $ANDROID_TARGET --abi $ANDROID_ABI -c 100M
|
|
- emulator -avd test -no-audio -no-window &
|
|
|
|
script:
|
|
- ./gradlew lintKiwixDebug jacocoTestKiwixDebugUnitTestReport
|
|
- android-wait-for-emulator
|
|
- adb shell input keyevent 82 &
|
|
- adb -e logcat *:D > logcat.log &
|
|
- ./gradlew createKiwixDebugCoverageReport
|
|
|
|
after_success:
|
|
- bash <(curl -s https://codecov.io/bash)
|
|
- ./gradlew kiwixtestUploadKiwix
|
|
|
|
after_failure:
|
|
- export LOG_DIR = ${TRAVIS_HOME}/build/kiwix/kiwix-android/app/build/outputs/reports/androidTests/connected/flavors/KIWIX/
|
|
- lynx --dump ${LOG_DIR}com.android.builder.testing.ConnectedDevice.html
|
|
- lynx --dump ${LOG_DIR}com.android.builder.testing.html
|
|
- lynx --dump ${LOG_DIR}org.kiwix.kiwixmobile.tests.BasicTest.html;
|
|
- echo " LOGCAT "; echo "========"; cat logcat.log; pkill -KILL -f adb
|
|
|
|
before_deploy:
|
|
# - export APP_CHANGELOG=$(cat app/src/kiwix/play/release-notes/en-US/default.txt)
|
|
- ./gradlew assembleKiwixRelease
|
|
|
|
deploy:
|
|
|
|
#publish on github releases
|
|
- provider: releases
|
|
api_key: "$GITHUB_TOKEN"
|
|
file: app/build/outputs/apk/kiwix/release/*
|
|
file_glob: true
|
|
skip_cleanup: true
|
|
overwrite: true
|
|
#body: "$APP_CHANGELOG" broken because travis can't escape newlines https://github.com/travis-ci/dpl/issues/155
|
|
draft: true
|
|
on:
|
|
tags: true
|
|
|
|
#publish on play store
|
|
- provider: script
|
|
skip_cleanup: true
|
|
script: ./gradlew publishKiwixRelease
|
|
on:
|
|
tags: true
|