.gitlab-ci.yml 1.84 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 9
variables:
  AVD_SDK: "17"
10 11
  # switch glibc to a memory conserving mode
  MALLOC_ARENA_MAX: "2"
12

13
gradle:
14
  script:
15
    - export GRADLE_USER_HOME=$PWD/.gradle
16
    # always report on lint errors to the build log
17
    - sed -i -e 's,textReport .*,textReport true,' app/build.gradle
18
    # 'build' means assemble and check
19
    - ./gradlew build -PdisablePreDex || {
20
          for log in app/build/reports/*ests/*/*ml; do
21
              echo "read $log here:";
22 23 24 25
              cat "$log" | curl --silent -F 'clbin=<-' https://clbin.com;
          done;
          exit 1;
      }
26
    - emulator64-arm -avd fcl-test-$AVD_SDK -no-skin -no-audio -no-window &
27
    - ./tools/wait-for-emulator
28
    - adb shell input keyevent 82 &
29
    - export EXITVALUE=0
30
    - ADB_INSTALL_TIMEOUT=8 ./gradlew connectedCheck -PdisablePreDex || {
31 32 33 34 35 36 37 38 39 40
        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
41
    - sed -n 's/.*"ctr2">\([0-9]*\)%<.*/Coverage - \1.0% covered\n/p' app/build/reports/coverage/debug/index.html
42 43
    # this file changes every time but should not be cached
    - rm -f $GRADLE_USER_HOME/caches/modules-2/modules-2.lock
44
    - exit $EXITVALUE
45 46 47 48

pmd:
  script:
    - export GRADLE_USER_HOME=$PWD/.gradle
49
    - ./gradlew pmd -PdisablePreDex
50 51 52 53

checkstyle:
  script:
    - export GRADLE_USER_HOME=$PWD/.gradle
54
    - ./gradlew checkstyle -PdisablePreDex
55 56 57

tools:
  script:
58
    - cd app
59 60
    - ./tools/langs-list-check.py
    - ./tools/check-string-format.py