.gitlab-ci.yml 2.56 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
before_script:
  - export GRADLE_USER_HOME=$PWD/.gradle
10 11
  - export ANDROID_COMPILE_SDK=`sed -n 's,.*compileSdkVersion\s*\([0-9][0-9]*\).*,\1,p' app/build.gradle`
  - echo y | android --silent update sdk --no-ui --filter android-${ANDROID_COMPILE_SDK}
12

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

33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51
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
52
  allow_failure: true
53

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

76 77 78 79
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/