.gitlab-ci.yml 3.18 KB
Newer Older
1
image: mvdan/fdroid-ci:client-20160909
Daniel Martí's avatar
Daniel Martí committed
2

3 4 5 6 7
cache:
  paths:
    - .gradle/wrapper
    - .gradle/caches

Daniel Martí's avatar
Daniel Martí committed
8
test:
9
  script:
10
    - export GRADLE_USER_HOME=$PWD/.gradle
11
    - ./gradlew assemble -PdisablePreDex
12
    # always report on lint errors to the build log
13
    - sed -i -e 's,textReport .*,textReport true,' app/build.gradle
14 15
    - ./gradlew lint -PdisablePreDex
    - ./gradlew test -PdisablePreDex || {
16
          for log in app/build/reports/*ests/*/*ml; do
17
              echo "read $log here:";
18 19 20 21
              cat "$log" | curl --silent -F 'clbin=<-' https://clbin.com;
          done;
          exit 1;
      }
22 23
    # this file changes every time but should not be cached
    - rm -f $GRADLE_USER_HOME/caches/modules-2/modules-2.lock
24
    - rm -fr $GRADLE_USER_HOME/caches/*/plugin-resolution/
25

26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49
connected10:
  variables:
    AVD_SDK: "10"
  script:
    - export GRADLE_USER_HOME=$PWD/.gradle
    - 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
    # this file changes every time but should not be cached
    - rm -f $GRADLE_USER_HOME/caches/modules-2/modules-2.lock
    - exit $EXITVALUE

50
connected24:
51
  variables:
52
    AVD_SDK: "24"
53 54
  script:
    - export GRADLE_USER_HOME=$PWD/.gradle
55
    - emulator64-x86 -avd fcl-test-$AVD_SDK -no-skin -no-audio -no-window &
56
    - ./tools/wait-for-emulator
57
    - adb shell input keyevent 82 &
58
    - export EXITVALUE=0
59
    - ./gradlew connectedCheck -PdisablePreDex || {
60 61 62 63 64 65 66 67 68 69
        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
70 71
    # this file changes every time but should not be cached
    - rm -f $GRADLE_USER_HOME/caches/modules-2/modules-2.lock
72
    - rm -fr $GRADLE_USER_HOME/caches/*/plugin-resolution/
73
    - exit $EXITVALUE
74 75 76 77

pmd:
  script:
    - export GRADLE_USER_HOME=$PWD/.gradle
78
    - ./gradlew pmd -PdisablePreDex
79 80
    # this file changes every time but should not be cached
    - rm -f $GRADLE_USER_HOME/caches/modules-2/modules-2.lock
81
    - rm -fr $GRADLE_USER_HOME/caches/*/plugin-resolution/
82 83 84 85

checkstyle:
  script:
    - export GRADLE_USER_HOME=$PWD/.gradle
86
    - ./gradlew checkstyle -PdisablePreDex
87 88
    # this file changes every time but should not be cached
    - rm -f $GRADLE_USER_HOME/caches/modules-2/modules-2.lock
89
    - rm -fr $GRADLE_USER_HOME/caches/*/plugin-resolution/
90 91 92

tools:
  script:
93
    - cd app
94 95
    - ./tools/langs-list-check.py
    - ./tools/check-string-format.py