BobStore/.gitlab-ci.yml
Hans-Christoph Steiner 4ae8bb3804 gitlab-ci: ensure the SDK is fully updated before running
This makes sure that the latest version of the core SDK components are
all current before running, which means that the builds will keep
working even when the docker image gets out of date. Then we can
finish the task we are working on before having to deal with updating
the docker image. Without that update line, we have to drop everything
and update the docker image when things are out of date.

Disk space and bandwidth is cheap, developer time is very scarce. We
should aim to keep the tests working as much as possible so that we
waste less developer time. Updating everytime only means it downloads
a little bit of XML each time, that's nothing compared to what gradle
downloads on every build.
2016-10-25 11:54:40 +03:30

91 lines
2.6 KiB
YAML

image: mvdan/fdroid-ci:client-20160909
cache:
paths:
- .gradle/wrapper
- .gradle/caches
before_script:
- export GRADLE_USER_HOME=$PWD/.gradle
- printf 'y\n\n' | android --verbose update sdk --no-ui
--filter extra-android-m2repository
test:
script:
- ./gradlew assemble -PdisablePreDex
# always report on lint errors to the build log
- sed -i -e 's,textReport .*,textReport true,' app/build.gradle
- ./gradlew lint -PdisablePreDex
- ./gradlew test -PdisablePreDex || {
for log in app/build/reports/*ests/*/*ml; do
echo "read $log here:";
cat "$log" | curl --silent -F 'clbin=<-' https://clbin.com;
done;
exit 1;
}
connected10:
variables:
AVD_SDK: "10"
script:
- 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 -PdisablePreDex || {
adb -e logcat -d '*:E';
echo "get the full logcat here:";
adb -e logcat -d | curl --silent -F 'clbin=<-' https://clbin.com;
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;
done
allow_failure: true
connected24:
variables:
AVD_SDK: "24"
script:
- emulator64-x86 -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 -PdisablePreDex || {
adb -e logcat -d '*:E';
echo "get the full logcat here:";
adb -e logcat -d | curl --silent -F 'clbin=<-' https://clbin.com;
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;
done
- exit $EXITVALUE
pmd:
script:
- ./gradlew pmd -PdisablePreDex
checkstyle:
script:
- ./gradlew checkstyle -PdisablePreDex
tools:
before_script:
- echo "ignored, no gradle needed"
script:
- cd app
- ./tools/langs-list-check.py
- ./tools/check-string-format.py
after_script:
- echo "ignored, no gradle needed"
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/