.gitlab-ci.yml 2.37 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 11
variables:
  AVD_SDK: "17"
  SKIN: "QVGA"

12
gradle:
13
  script:
14 15
    - 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
16
    - export GRADLE_USER_HOME=$PWD/.gradle
17
    # always report on lint errors to the build log
18
    - sed -i -e 's,textReport .*,textReport true,' app/build.gradle
19
    # 'build' means assemble and check
20
    - ./gradlew build -PdisablePreDex || {
21 22 23 24 25 26
          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;
      }
27 28 29 30 31 32 33 34 35 36 37 38
    # 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
39
    - emulator64-arm -avd fcl-test -no-skin -no-audio -no-window &
40
    - ./tools/wait-for-emulator
41
    - adb shell input keyevent 82
42
    - export EXITVALUE=0
43
    - ADB_INSTALL_TIMEOUT=8 ./gradlew connectedCheck -PdisablePreDex || {
44 45 46 47 48 49 50 51 52 53
        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
54
    - sed -n 's/.*"ctr2">\([0-9]*\)%<.*/Coverage - \1.0% covered\n/p' app/build/reports/coverage/debug/index.html
55
    - exit $EXITVALUE
56 57 58 59

pmd:
  script:
    - export GRADLE_USER_HOME=$PWD/.gradle
60
    - ./gradlew pmd -PdisablePreDex
61 62 63 64

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

tools:
  script:
69
    - cd app
70 71
    - ./tools/langs-list-check.py
    - ./tools/check-string-format.py