.gitlab-ci.yml 2.89 KB
Newer Older
1
image: registry.gitlab.com/fdroid/ci-images-client:latest
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
    - export EXITVALUE=0
16
    - ./tools/check-format-strings.py
17
    - ./tools/remove-unused-and-blank-translations.py
18 19
    - echo "These are unused or blank translations that should be removed:"
    - git --no-pager diff --exit-code || export EXITVALUE=1
20
    - ./gradlew assemble -PdisablePreDex
21
    # always report on lint errors to the build log
22
    - sed -i -e 's,textReport .*,textReport true,' app/build.gradle
23
    - ./gradlew lint -PdisablePreDex
24 25
    - ./gradlew pmd -PdisablePreDex
    - ./gradlew checkstyle -PdisablePreDex
26
    - ./gradlew test -PdisablePreDex || {
27
          for log in app/build/reports/*ests/*/*ml; do
28
              echo "read $log here:";
29
              (cat "$log" | curl --silent -F 'clbin=<-' https://clbin.com) || true;
30
          done;
31
          export EXITVALUE=1;
32
      }
33
    - exit $EXITVALUE
34

35 36 37 38
connected10:
  variables:
    AVD_SDK: "10"
  script:
39
    - ./gradlew assembleDebug -PdisablePreDex
40 41 42 43 44 45 46
    - 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:";
47
        (adb -e logcat -d | curl --silent -F 'clbin=<-' https://clbin.com) || true;
48 49 50 51 52
        export EXITVALUE=1;
      }
    - for log in app/build/reports/*ests/*/*ml
                 app/build/outputs/*results*/connected/*.xml; do
        echo "read $log here:";
53
        (cat "$log" | curl --silent -F 'clbin=<-' https://clbin.com) || true;
54 55
      done

56
connected24:
57
  variables:
58
    AVD_SDK: "24"
59
  script:
60
    - ./gradlew assembleDebug -PdisablePreDex
61
    - android list avd
62
    - emulator64-arm -avd fcl-test-$AVD_SDK -no-audio -no-window &
63
    - ./tools/wait-for-emulator
64
    - adb shell input keyevent 82 &
65
    - adb devices
66
    - export EXITVALUE=0
67
    - ./gradlew connectedCheck -PdisablePreDex || {
68 69
        adb -e logcat -d '*:E';
        echo "get the full logcat here:";
70
        (adb -e logcat -d | curl --silent -F 'clbin=<-' https://clbin.com) || true;
71 72 73 74 75
        export EXITVALUE=1;
      }
    - for log in app/build/reports/*ests/*/*ml
                 app/build/outputs/*results*/connected/*.xml; do
        echo "read $log here:";
76
        (cat "$log" | curl --silent -F 'clbin=<-' https://clbin.com) || true;
77 78
      done
    - exit $EXITVALUE
79

80 81 82 83
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/