.gitlab-ci.yml 2.14 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
    # always report on lint errors to the build log
12
    - sed -i -e 's,textReport .*,textReport true,' app/build.gradle
13
    # 'build' means assemble and check
14
    - ./gradlew build -PdisablePreDex || {
15
          for log in app/build/reports/*ests/*/*ml; do
16
              echo "read $log here:";
17 18 19 20
              cat "$log" | curl --silent -F 'clbin=<-' https://clbin.com;
          done;
          exit 1;
      }
21 22
    # this file changes every time but should not be cached
    - rm -f $GRADLE_USER_HOME/caches/modules-2/modules-2.lock
23 24

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

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

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

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