.gitlab-ci.yml 2.38 KB
Newer Older
1
image: registry.gitlab.com/fdroid/ci-images:client
Daniel Martí's avatar
Daniel Martí committed
2

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

8 9 10
before_script:
  - export GRADLE_USER_HOME=$PWD/.gradle

Daniel Martí's avatar
Daniel Martí committed
11
test:
12
  script:
13 14 15 16
    - cd app
    - ./tools/langs-list-check.py
    - ./tools/check-string-format.py
    - cd ..
17
    - ./gradlew assemble -PdisablePreDex
18
    # always report on lint errors to the build log
19
    - sed -i -e 's,textReport .*,textReport true,' app/build.gradle
20
    - ./gradlew lint -PdisablePreDex
21 22
    - ./gradlew pmd -PdisablePreDex
    - ./gradlew checkstyle -PdisablePreDex
23
    - ./gradlew test -PdisablePreDex || {
24
          for log in app/build/reports/*ests/*/*ml; do
25
              echo "read $log here:";
26 27 28 29
              cat "$log" | curl --silent -F 'clbin=<-' https://clbin.com;
          done;
          exit 1;
      }
30

31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49
connected10:
  variables:
    AVD_SDK: "10"
  script:
    - emulator64-arm -avd fcl-test-$AVD_SDK -no-skin -no-audio -no-window &
    - ./tools/wait-for-emulator
    - adb shell input keyevent 82 &
    - export EXITVALUE=0
    - ./gradlew connectedCheck -PdisablePreDex || {
        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
50
  allow_failure: true
51

52
connected24:
53
  variables:
54
    AVD_SDK: "24"
55
  script:
56
    - emulator64-arm -avd fcl-test-$AVD_SDK -no-skin -no-audio -no-window &
57
    - ./tools/wait-for-emulator
58
    - adb shell input keyevent 82 &
59
    - export EXITVALUE=0
60
    - ./gradlew connectedCheck -PdisablePreDex || {
61 62 63 64 65 66 67 68 69 70 71
        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
    - exit $EXITVALUE
Peter Serwylo's avatar
Peter Serwylo committed
72
  allow_failure: true
73

74 75 76 77
after_script:
    # this file changes every time but should not be cached
    - rm -f $GRADLE_USER_HOME/caches/modules-2/modules-2.lock
    - rm -fr $GRADLE_USER_HOME/caches/*/plugin-resolution/