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

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

8 9 10
variables:
  AVD_SDK: "17"
  SKIN: "QVGA"
11 12
  # switch glibc to a memory conserving mode
  MALLOC_ARENA_MAX: "2"
13

14
gradle:
15
  script:
16 17
    - echo y | android update sdk --no-ui --filter android-$AVD_SDK
    - echo y | android update sdk --no-ui --all --filter sys-img-armeabi-v7a-android-$AVD_SDK
18
    - export GRADLE_USER_HOME=$PWD/.gradle
19
    # always report on lint errors to the build log
20
    - sed -i -e 's,textReport .*,textReport true,' app/build.gradle
21
    # 'build' means assemble and check
22
    - ./gradlew build -PdisablePreDex || {
23 24 25 26 27 28
          for log in app/build/reports/*ests/*/*ml; do
              echo "read $log here:"
              cat "$log" | curl --silent -F 'clbin=<-' https://clbin.com;
          done;
          exit 1;
      }
29 30 31 32 33 34 35 36 37 38 39 40
    # emulators will only start if they have tiny amounts of RAM
    - sed -i -e 's,^hw.ramSize=.*,hw.ramSize=384,'
             -e 's,^vm.heapSize=.*,vm.heapSize=48,'
             -e 's,^hw.gpu.enabled.*,hw.gpu.enabled = false,'
             $ANDROID_HOME/platforms/android-$AVD_SDK/skins/$SKIN/hardware.ini
    - echo "hw.gpu.enabled = false" >>
             $ANDROID_HOME/platforms/android-$AVD_SDK/skins/$SKIN/hardware.ini
    - echo no | android --verbose create avd
        --force
        --name fcl-test
        --skin $SKIN
        --target android-$AVD_SDK
Daniel Martí's avatar
Daniel Martí committed
41
    - emulator64-arm -avd fcl-test -no-skin -no-audio -no-window &
42
    - ./tools/wait-for-emulator
43
    - adb shell input keyevent 82 &
44
    - export EXITVALUE=0
45
    - ADB_INSTALL_TIMEOUT=8 ./gradlew connectedCheck -PdisablePreDex || {
46 47 48 49 50 51 52 53 54 55
        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
56
    - sed -n 's/.*"ctr2">\([0-9]*\)%<.*/Coverage - \1.0% covered\n/p' app/build/reports/coverage/debug/index.html
57 58
    # this file changes every time but should not be cached
    - rm -f $GRADLE_USER_HOME/caches/modules-2/modules-2.lock
59
    - exit $EXITVALUE
60 61 62 63

pmd:
  script:
    - export GRADLE_USER_HOME=$PWD/.gradle
64
    - ./gradlew pmd -PdisablePreDex
65 66 67 68

checkstyle:
  script:
    - export GRADLE_USER_HOME=$PWD/.gradle
69
    - ./gradlew checkstyle -PdisablePreDex
70 71 72

tools:
  script:
73
    - cd app
74 75
    - ./tools/langs-list-check.py
    - ./tools/check-string-format.py