From e18e7a7067c7c8f55f39afedd34bb295a971332b Mon Sep 17 00:00:00 2001 From: Hans-Christoph Steiner Date: Wed, 24 Feb 2016 20:31:42 +0100 Subject: [PATCH 1/2] gitlab-ci: cache downloaded things between builds This stores the Android SDK tarball and gradle caches between builds to speed things up. Since the unpacked SDK gets unpacked very time, updating the version is just a matter of changing the variable. Since only the gradle caches are stored, i.e. the jars and gradle binaries, updates there will only add more files to the cache. --- .gitlab-ci.yml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 002b26310..2850ffc31 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -1,7 +1,13 @@ image: mvdan/fdroid-ci:latest +cache: + paths: + - .gradle/wrapper + - .gradle/caches + test: script: + - export GRADLE_USER_HOME=$PWD/.gradle - cd F-Droid - ./tools/langs-list-check.py - ./tools/check-string-format.py From d4992831c073bf99cd9f3683d3876243f79d5e60 Mon Sep 17 00:00:00 2001 From: Hans-Christoph Steiner Date: Wed, 24 Feb 2016 22:59:01 +0100 Subject: [PATCH 2/2] gitlab-ci: enable lint and run tools scripts in parallel * splitting out the tools script allows less things to happen on the main job, and runs the tools script in parallel, which should speed things up. * `gradle check` also runs lint, and anything else we might add to that meta-target. * `gradle build` also runs tests, `gradle assemble` does not --- .gitlab-ci.yml | 29 +++++++++++++++++++++-------- 1 file changed, 21 insertions(+), 8 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 2850ffc31..96104a3dd 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -5,19 +5,32 @@ cache: - .gradle/wrapper - .gradle/caches -test: +gradle: script: - export GRADLE_USER_HOME=$PWD/.gradle - - cd F-Droid - - ./tools/langs-list-check.py - - ./tools/check-string-format.py - - cd .. - - ./gradlew build - - ./gradlew checkstyle - - ./gradlew pmd + - ./gradlew assemble + # always report on lint errors to the build log + - sed -i -e 's,textReport .*,textReport true,' F-Droid/build.gradle + - ./gradlew check - echo no | android create avd --force -n fcl-test -t android-10 -b armeabi - emulator -force-32bit -avd fcl-test -no-skin -no-audio -no-window & - ./tools/wait-for-emulator - adb shell input keyevent 82 - ADB_INSTALL_TIMEOUT=8 ./gradlew connectedCheck || { adb logcat -d '*:W'; exit 1; } - sed -n 's/.*"ctr2">\([0-9]*\)%<.*/Coverage - \1.0% covered\n/p' F-Droid/build/reports/coverage/debug/index.html + +pmd: + script: + - export GRADLE_USER_HOME=$PWD/.gradle + - ./gradlew pmd + +checkstyle: + script: + - export GRADLE_USER_HOME=$PWD/.gradle + - ./gradlew checkstyle + +tools: + script: + - cd F-Droid + - ./tools/langs-list-check.py + - ./tools/check-string-format.py