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

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

8
build:
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 25

connectedCheck:
26 27 28 29
  variables:
    AVD_SDK: "17"
    # switch glibc to a memory conserving mode
    MALLOC_ARENA_MAX: "2"
30 31
  script:
    - export GRADLE_USER_HOME=$PWD/.gradle
32
    - emulator64-arm -avd fcl-test-$AVD_SDK -no-skin -no-audio -no-window &
33
    - ./tools/wait-for-emulator
34
    - adb shell input keyevent 82 &
35
    - export EXITVALUE=0
36
    - ./gradlew connectedCheck -PdisablePreDex || {
37 38 39 40 41 42 43 44 45 46
        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
47 48
    # this file changes every time but should not be cached
    - rm -f $GRADLE_USER_HOME/caches/modules-2/modules-2.lock
49
    - exit $EXITVALUE
50 51 52 53

pmd:
  script:
    - export GRADLE_USER_HOME=$PWD/.gradle
54
    - ./gradlew pmd -PdisablePreDex
55 56
    # this file changes every time but should not be cached
    - rm -f $GRADLE_USER_HOME/caches/modules-2/modules-2.lock
57 58 59 60

checkstyle:
  script:
    - export GRADLE_USER_HOME=$PWD/.gradle
61
    - ./gradlew checkstyle -PdisablePreDex
62 63
    # this file changes every time but should not be cached
    - rm -f $GRADLE_USER_HOME/caches/modules-2/modules-2.lock
64 65 66

tools:
  script:
67
    - cd app
68 69
    - ./tools/langs-list-check.py
    - ./tools/check-string-format.py