.gitlab-ci.yml 2.74 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
    - ./tools/check-format-strings.py
16 17
    - ./tools/remove-unused-and-blank-translations.py
    - git diff | grep diff && false # there should be no changes
18
    - ./gradlew assemble -PdisablePreDex
19
    # always report on lint errors to the build log
20
    - sed -i -e 's,textReport .*,textReport true,' app/build.gradle
21
    - ./gradlew lint -PdisablePreDex
22 23
    - ./gradlew pmd -PdisablePreDex
    - ./gradlew checkstyle -PdisablePreDex
24
    - ./gradlew test -PdisablePreDex || {
25
          for log in app/build/reports/*ests/*/*ml; do
26
              echo "read $log here:";
27 28 29 30
              cat "$log" | curl --silent -F 'clbin=<-' https://clbin.com;
          done;
          exit 1;
      }
31

32 33 34 35
connected10:
  variables:
    AVD_SDK: "10"
  script:
36
    - ./gradlew assembleDebug -PdisablePreDex
37 38 39 40 41 42 43 44 45 46 47 48 49 50 51
    - 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
    - ./gradlew assembleDebug -PdisablePreDex
59
    - android list avd
60
    - emulator64-arm -avd fcl-test-$AVD_SDK -no-audio -no-window &
61
    - ./tools/wait-for-emulator
62
    - adb shell input keyevent 82 &
63
    - adb devices
64
    - export EXITVALUE=0
65
    - ./gradlew connectedCheck -PdisablePreDex || {
66 67 68 69 70 71 72 73 74 75 76
        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
77

78 79 80 81
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/