blob: 089f63dc03fcf7073a6fb95a2b35988ff0757690 [file] [log] [blame]
Hans-Christoph Steiner8407a8c2017-09-05 18:46:56 +02001image: registry.gitlab.com/fdroid/ci-images-client:latest
Hans-Christoph Steiner91d025c2016-08-08 16:35:46 +02002
3cache:
4 paths:
5 - .gradle/wrapper
6 - .gradle/caches
7
Hans-Christoph Steinera00e48d2017-03-17 12:22:32 +01008before_script:
Hans-Christoph Steiner9e4d1e82017-03-17 12:23:44 +01009 - export GRADLE_USER_HOME=$PWD/.gradle
Hans-Christoph Steinera00e48d2017-03-17 12:22:32 +010010 - export ANDROID_COMPILE_SDK=`sed -n 's,.*compileSdkVersion\s*\([0-9][0-9]*\).*,\1,p' app/build.gradle`
11 - echo y | android --silent update sdk --no-ui --filter android-${ANDROID_COMPILE_SDK}
12 - export ANDROID_BUILD_TOOLS=`sed -n "s,.*buildToolsVersion\s*'\([0-9][0-9.]*\)'.*,\1,p" app/build.gradle`
13 - echo y | android --silent update sdk --no-ui --all --filter android-${ANDROID_BUILD_TOOLS}
Hans-Christoph Steiner8407a8c2017-09-05 18:46:56 +020014 - apt-get update && apt-get -y install gnupg
Hans-Christoph Steinera00e48d2017-03-17 12:22:32 +010015
Hans-Christoph Steiner91d025c2016-08-08 16:35:46 +020016test:
17 script:
Hans-Christoph Steiner8cb5c092017-03-17 12:12:32 +010018 - ./gradlew checkstyle
Hans-Christoph Steiner8213e3b2017-04-21 13:37:21 +020019 - ./gradlew assembleDebug
20 - ./create_ota.sh debug
Hans-Christoph Steiner73474d22018-03-21 17:32:45 +010021 - printf "key.store=${HOME}/.android/debug.keystore\nkey.store.password=android\nkey.alias=androiddebugkey\nkey.alias.password=android\n" > signing.properties
22 - ./create_ota.sh release
Hans-Christoph Steinere40a2502016-08-08 16:36:31 +020023 # always report on lint errors to the build log
24 - sed -i -e 's,textReport .*,textReport true,' app/build.gradle
Hans-Christoph Steiner899f6da2016-08-09 16:33:17 +020025 - ./gradlew build || {
Hans-Christoph Steiner91d025c2016-08-08 16:35:46 +020026 for log in app/build/reports/*ests/*/*ml; do
27 echo "read $log here:";
28 cat "$log" | curl --silent -F 'clbin=<-' https://clbin.com;
29 done;
30 exit 1;
31 }
Hans-Christoph Steiner03c1cd52017-04-24 11:14:32 +020032 - echo "use versionCode that is known to exist on f-droid.org for test:"
Hans-Christoph Steinerbedc6642018-03-21 17:32:11 +010033 - sed -i 's,versionCode="[^"]*",versionCode="2070",' app/src/main/AndroidManifest.xml
Hans-Christoph Steiner8213e3b2017-04-21 13:37:21 +020034 - ./create_ota.sh release binaries
Hans-Christoph Steiner0887baf2016-08-10 11:59:12 +020035
36connected10:
37 variables:
38 AVD_SDK: "10"
39 script:
Hans-Christoph Steiner0887baf2016-08-10 11:59:12 +020040 - emulator64-arm -avd fcl-test-$AVD_SDK -no-skin -no-audio -no-window &
41 - ./tools/wait-for-emulator
42 - adb shell input keyevent 82 &
43 - export EXITVALUE=0
44 - ./gradlew connectedCheck || {
45 adb -e logcat -d '*:E';
46 echo "get the full logcat here:";
47 adb -e logcat -d | curl --silent -F 'clbin=<-' https://clbin.com;
48 export EXITVALUE=1;
49 }
50 - for log in app/build/reports/*ests/*/*ml
51 app/build/outputs/*results*/connected/*.xml; do
52 echo "read $log here:";
53 cat "$log" | curl --silent -F 'clbin=<-' https://clbin.com;
54 done
Hans-Christoph Steiner0887baf2016-08-10 11:59:12 +020055
56connected24:
57 variables:
58 AVD_SDK: "24"
59 script:
Hans-Christoph Steiner4cbb57f2017-03-17 12:24:11 +010060 - emulator64-arm -avd fcl-test-$AVD_SDK -no-audio -no-window &
Hans-Christoph Steiner0887baf2016-08-10 11:59:12 +020061 - ./tools/wait-for-emulator
62 - adb shell input keyevent 82 &
63 - export EXITVALUE=0
64 - ./gradlew connectedCheck || {
65 adb -e logcat -d '*:E';
66 echo "get the full logcat here:";
67 adb -e logcat -d | curl --silent -F 'clbin=<-' https://clbin.com;
68 export EXITVALUE=1;
69 }
70 - for log in app/build/reports/*ests/*/*ml
71 app/build/outputs/*results*/connected/*.xml; do
72 echo "read $log here:";
73 cat "$log" | curl --silent -F 'clbin=<-' https://clbin.com;
74 done
Hans-Christoph Steiner9e4d1e82017-03-17 12:23:44 +010075 - exit $EXITVALUE
76
77after_script:
Hans-Christoph Steiner0887baf2016-08-10 11:59:12 +020078 # this file changes every time but should not be cached
79 - rm -f $GRADLE_USER_HOME/caches/modules-2/modules-2.lock
80 - rm -fr $GRADLE_USER_HOME/caches/*/plugin-resolution/