.gitlab-ci.yml 2.97 KB
Newer Older
1 2 3
image: registry.gitlab.com/eighthave/ci-images-client:latest
# re-enable once gitlab support fixes the repo :-/
#image: registry.gitlab.com/fdroid/ci-images-client:latest
Daniel Martí's avatar
Daniel Martí committed
4

5 6 7 8 9
cache:
  paths:
    - .gradle/wrapper
    - .gradle/caches

10 11
before_script:
  - export GRADLE_USER_HOME=$PWD/.gradle
12 13
  - 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}
14

Daniel Martí's avatar
Daniel Martí committed
15
test:
16
  script:
17
    - export EXITVALUE=0
18
    - ./tools/check-format-strings.py
19
    - ./tools/remove-unused-and-blank-translations.py
20 21
    - echo "These are unused or blank translations that should be removed:"
    - git --no-pager diff --exit-code || export EXITVALUE=1
22
    - ./gradlew assemble -PdisablePreDex
23
    # always report on lint errors to the build log
24
    - sed -i -e 's,textReport .*,textReport true,' app/build.gradle
25
    - ./gradlew lint -PdisablePreDex
26 27
    - ./gradlew pmd -PdisablePreDex
    - ./gradlew checkstyle -PdisablePreDex
28
    - ./gradlew test -PdisablePreDex || {
29
          for log in app/build/reports/*ests/*/*ml; do
30
              echo "read $log here:";
31 32
              cat "$log" | curl --silent -F 'clbin=<-' https://clbin.com;
          done;
33
          export EXITVALUE=1;
34
      }
35
    - exit $EXITVALUE
36

37 38 39 40
connected10:
  variables:
    AVD_SDK: "10"
  script:
41
    - ./gradlew assembleDebug -PdisablePreDex
42 43 44 45 46 47 48 49 50 51 52 53 54 55 56
    - 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
57
  allow_failure: true
58

59
connected24:
60
  variables:
61
    AVD_SDK: "24"
62
  script:
63
    - ./gradlew assembleDebug -PdisablePreDex
64
    - android list avd
65
    - emulator64-arm -avd fcl-test-$AVD_SDK -no-audio -no-window &
66
    - ./tools/wait-for-emulator
67
    - adb shell input keyevent 82 &
68
    - adb devices
69
    - export EXITVALUE=0
70
    - ./gradlew connectedCheck -PdisablePreDex || {
71 72 73 74 75 76 77 78 79 80 81
        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
82

83 84 85 86
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/