104 lines
3.4 KiB
YAML
104 lines
3.4 KiB
YAML
image: registry.gitlab.com/fdroid/ci-images-client:latest
|
|
|
|
cache:
|
|
paths:
|
|
- .gradle/wrapper
|
|
- .gradle/caches
|
|
|
|
stages:
|
|
- test
|
|
- deploy
|
|
|
|
before_script:
|
|
- export GRADLE_USER_HOME=$PWD/.gradle
|
|
- export ANDROID_COMPILE_SDK=`sed -n 's,.*compileSdkVersion\s*\([0-9][0-9]*\).*,\1,p' app/build.gradle`
|
|
- echo y | android --silent update sdk --no-ui --filter android-${ANDROID_COMPILE_SDK}
|
|
|
|
test:
|
|
stage: test
|
|
script:
|
|
- export EXITVALUE=0
|
|
- ./tools/check-format-strings.py
|
|
- ./tools/remove-unused-and-blank-translations.py
|
|
- echo "These are unused or blank translations that should be removed:"
|
|
- git --no-pager diff --exit-code || export EXITVALUE=1
|
|
- ./gradlew assemble
|
|
# always report on lint errors to the build log
|
|
- sed -i -e 's,textReport .*,textReport true,' app/build.gradle
|
|
- ./gradlew lint
|
|
- ./gradlew pmd
|
|
- ./gradlew checkstyle
|
|
- ./gradlew test || {
|
|
for log in app/build/reports/*ests/*/*ml; do
|
|
echo "read $log here:";
|
|
(cat "$log" | curl --silent -F 'clbin=<-' https://clbin.com) || true;
|
|
done;
|
|
export EXITVALUE=1;
|
|
}
|
|
- exit $EXITVALUE
|
|
|
|
connected10:
|
|
stage: test
|
|
variables:
|
|
AVD_SDK: "10"
|
|
script:
|
|
- ./gradlew assembleDebug
|
|
- emulator64-arm -avd fcl-test-$AVD_SDK -no-skin -no-audio -no-window &
|
|
- ./tools/wait-for-emulator
|
|
- adb shell input keyevent 82 &
|
|
- export EXITVALUE=0
|
|
- ./gradlew connectedCheck || {
|
|
adb -e logcat -d '*:E';
|
|
echo "get the full logcat here:";
|
|
(adb -e logcat -d | curl --silent -F 'clbin=<-' https://clbin.com) || true;
|
|
export EXITVALUE=1;
|
|
}
|
|
- for log in app/build/reports/*ests/*/*ml
|
|
app/build/outputs/*results*/connected/*.xml; do
|
|
echo "read $log here:";
|
|
(cat "$log" | curl --silent -F 'clbin=<-' https://clbin.com) || true;
|
|
done
|
|
|
|
connected24:
|
|
stage: test
|
|
variables:
|
|
AVD_SDK: "24"
|
|
script:
|
|
- ./gradlew assembleDebug
|
|
- android list avd
|
|
- emulator64-arm -avd fcl-test-$AVD_SDK -no-audio -no-window &
|
|
- ./tools/wait-for-emulator
|
|
- adb shell input keyevent 82 &
|
|
- adb devices
|
|
- export EXITVALUE=0
|
|
- ./gradlew connectedCheck || {
|
|
adb -e logcat -d '*:E';
|
|
echo "get the full logcat here:";
|
|
(adb -e logcat -d | curl --silent -F 'clbin=<-' https://clbin.com) || true;
|
|
export EXITVALUE=1;
|
|
}
|
|
- for log in app/build/reports/*ests/*/*ml
|
|
app/build/outputs/*results*/connected/*.xml; do
|
|
echo "read $log here:";
|
|
(cat "$log" | curl --silent -F 'clbin=<-' https://clbin.com) || true;
|
|
done
|
|
- exit $EXITVALUE
|
|
|
|
deploy_nightly:
|
|
stage: deploy
|
|
only:
|
|
- master
|
|
script:
|
|
- sed -i -e '/<\/string-array>/d' -e '/<\/resources>/d' app/src/main/res/values/default_repos.xml
|
|
- echo "<item>${CI_PROJECT_PATH}-nightly</item>" >> app/src/main/res/values/default_repos.xml
|
|
- echo "<item>${CI_PROJECT_URL}-nightly/raw/master/fdroid/repo</item>" >> app/src/main/res/values/default_repos.xml
|
|
- cat config/nightly-repo/repo.xml >> app/src/main/res/values/default_repos.xml
|
|
- ./gradlew assembleDebug
|
|
- apt update; apt install -y --no-install-recommends fdroidserver python3-qrcode openssh-client
|
|
- fdroid nightly -v
|
|
|
|
after_script:
|
|
# this file changes every time but should not be cached
|
|
- rm -f $GRADLE_USER_HOME/caches/modules-2/modules-2.lock
|
|
- rm -fr $GRADLE_USER_HOME/caches/*/plugin-resolution/
|