Hans-Christoph Steiner | 8407a8c | 2017-09-05 18:46:56 +0200 | [diff] [blame] | 1 | image: registry.gitlab.com/fdroid/ci-images-client:latest |
Hans-Christoph Steiner | 91d025c | 2016-08-08 16:35:46 +0200 | [diff] [blame] | 2 | |
| 3 | cache: |
| 4 | paths: |
| 5 | - .gradle/wrapper |
| 6 | - .gradle/caches |
| 7 | |
Hans-Christoph Steiner | a00e48d | 2017-03-17 12:22:32 +0100 | [diff] [blame] | 8 | before_script: |
Hans-Christoph Steiner | 9e4d1e8 | 2017-03-17 12:23:44 +0100 | [diff] [blame] | 9 | - export GRADLE_USER_HOME=$PWD/.gradle |
Hans-Christoph Steiner | a00e48d | 2017-03-17 12:22:32 +0100 | [diff] [blame] | 10 | - 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 Steiner | 8407a8c | 2017-09-05 18:46:56 +0200 | [diff] [blame] | 14 | - apt-get update && apt-get -y install gnupg |
Hans-Christoph Steiner | a00e48d | 2017-03-17 12:22:32 +0100 | [diff] [blame] | 15 | |
Hans-Christoph Steiner | 91d025c | 2016-08-08 16:35:46 +0200 | [diff] [blame] | 16 | test: |
| 17 | script: |
Hans-Christoph Steiner | 8cb5c09 | 2017-03-17 12:12:32 +0100 | [diff] [blame] | 18 | - ./gradlew checkstyle |
Hans-Christoph Steiner | 8213e3b | 2017-04-21 13:37:21 +0200 | [diff] [blame] | 19 | - ./gradlew assembleDebug |
| 20 | - ./create_ota.sh debug |
Hans-Christoph Steiner | 73474d2 | 2018-03-21 17:32:45 +0100 | [diff] [blame^] | 21 | - 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 Steiner | e40a250 | 2016-08-08 16:36:31 +0200 | [diff] [blame] | 23 | # always report on lint errors to the build log |
| 24 | - sed -i -e 's,textReport .*,textReport true,' app/build.gradle |
Hans-Christoph Steiner | 899f6da | 2016-08-09 16:33:17 +0200 | [diff] [blame] | 25 | - ./gradlew build || { |
Hans-Christoph Steiner | 91d025c | 2016-08-08 16:35:46 +0200 | [diff] [blame] | 26 | 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 Steiner | 03c1cd5 | 2017-04-24 11:14:32 +0200 | [diff] [blame] | 32 | - echo "use versionCode that is known to exist on f-droid.org for test:" |
Hans-Christoph Steiner | bedc664 | 2018-03-21 17:32:11 +0100 | [diff] [blame] | 33 | - sed -i 's,versionCode="[^"]*",versionCode="2070",' app/src/main/AndroidManifest.xml |
Hans-Christoph Steiner | 8213e3b | 2017-04-21 13:37:21 +0200 | [diff] [blame] | 34 | - ./create_ota.sh release binaries |
Hans-Christoph Steiner | 0887baf | 2016-08-10 11:59:12 +0200 | [diff] [blame] | 35 | |
| 36 | connected10: |
| 37 | variables: |
| 38 | AVD_SDK: "10" |
| 39 | script: |
Hans-Christoph Steiner | 0887baf | 2016-08-10 11:59:12 +0200 | [diff] [blame] | 40 | - 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 Steiner | 0887baf | 2016-08-10 11:59:12 +0200 | [diff] [blame] | 55 | |
| 56 | connected24: |
| 57 | variables: |
| 58 | AVD_SDK: "24" |
| 59 | script: |
Hans-Christoph Steiner | 4cbb57f | 2017-03-17 12:24:11 +0100 | [diff] [blame] | 60 | - emulator64-arm -avd fcl-test-$AVD_SDK -no-audio -no-window & |
Hans-Christoph Steiner | 0887baf | 2016-08-10 11:59:12 +0200 | [diff] [blame] | 61 | - ./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 Steiner | 9e4d1e8 | 2017-03-17 12:23:44 +0100 | [diff] [blame] | 75 | - exit $EXITVALUE |
| 76 | |
| 77 | after_script: |
Hans-Christoph Steiner | 0887baf | 2016-08-10 11:59:12 +0200 | [diff] [blame] | 78 | # 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/ |