From a3b6185942ac5bf301e54835a5408ec442090764 Mon Sep 17 00:00:00 2001 From: Hans-Christoph Steiner Date: Tue, 27 Sep 2016 13:08:30 +0200 Subject: [PATCH 1/4] gitlab-ci: reduce connected10 from error to warning connected10 is still flaky since the emulator crashes a lot. Marking it for "allow_failure" will still show a warning, but it won't fail the build. --- .gitlab-ci.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 26d65b31f..8b0c82532 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -46,6 +46,7 @@ connected10: # this file changes every time but should not be cached - rm -f $GRADLE_USER_HOME/caches/modules-2/modules-2.lock - exit $EXITVALUE + allow_failure: true connected24: variables: From f0d9675b55843ef2f43e8cc683eda9eb461e2cc6 Mon Sep 17 00:00:00 2001 From: Hans-Christoph Steiner Date: Tue, 27 Sep 2016 16:19:45 +0200 Subject: [PATCH 2/4] gitlab-ci: use before and after script for reused chunks It also reduces redundancy by using before_script and after_script blocks. --- .gitlab-ci.yml | 32 ++++++++++++-------------------- 1 file changed, 12 insertions(+), 20 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 8b0c82532..bd609d033 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -5,9 +5,11 @@ cache: - .gradle/wrapper - .gradle/caches +before_script: + - export GRADLE_USER_HOME=$PWD/.gradle + test: script: - - export GRADLE_USER_HOME=$PWD/.gradle - ./gradlew assemble -PdisablePreDex # always report on lint errors to the build log - sed -i -e 's,textReport .*,textReport true,' app/build.gradle @@ -19,15 +21,11 @@ test: done; exit 1; } - # 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/ connected10: variables: AVD_SDK: "10" script: - - export GRADLE_USER_HOME=$PWD/.gradle - emulator64-arm -avd fcl-test-$AVD_SDK -no-skin -no-audio -no-window & - ./tools/wait-for-emulator - adb shell input keyevent 82 & @@ -43,16 +41,12 @@ connected10: echo "read $log here:"; cat "$log" | curl --silent -F 'clbin=<-' https://clbin.com; done - # this file changes every time but should not be cached - - rm -f $GRADLE_USER_HOME/caches/modules-2/modules-2.lock - - exit $EXITVALUE allow_failure: true connected24: variables: AVD_SDK: "24" script: - - export GRADLE_USER_HOME=$PWD/.gradle - emulator64-x86 -avd fcl-test-$AVD_SDK -no-skin -no-audio -no-window & - ./tools/wait-for-emulator - adb shell input keyevent 82 & @@ -68,29 +62,27 @@ connected24: echo "read $log here:"; cat "$log" | curl --silent -F 'clbin=<-' https://clbin.com; done - # 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/ - exit $EXITVALUE pmd: script: - - export GRADLE_USER_HOME=$PWD/.gradle - ./gradlew pmd -PdisablePreDex - # 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/ checkstyle: script: - - export GRADLE_USER_HOME=$PWD/.gradle - ./gradlew checkstyle -PdisablePreDex - # 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/ tools: + before_script: + - echo "ignored, no gradle needed" script: - cd app - ./tools/langs-list-check.py - ./tools/check-string-format.py + after_script: + - echo "ignored, no gradle needed" + +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/ From 5e549193f1b8f8b5811725def9e94030d14aa10a Mon Sep 17 00:00:00 2001 From: Hans-Christoph Steiner Date: Tue, 27 Sep 2016 16:20:33 +0200 Subject: [PATCH 3/4] gitlab-ci: ensure the SDK is fully updated before running This makes sure that the latest version of the core SDK components are all current before running, which means that the builds will keep working even when the docker image gets out of date. Then we can finish the task we are working on before having to deal with updating the docker image. Without that update line, we have to drop everything and update the docker image when things are out of date. Disk space and bandwidth is cheap, developer time is very scarce. We should aim to keep the tests working as much as possible so that we waste less developer time. Updating everytime only means it downloads a little bit of XML each time, that's nothing compared to what gradle downloads on every build. --- .gitlab-ci.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index bd609d033..e50b1203a 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -7,6 +7,8 @@ cache: before_script: - export GRADLE_USER_HOME=$PWD/.gradle + - printf 'y\n\n' | android --verbose update sdk --no-ui + --filter extra-android-m2repository test: script: From dd134c50bc92e8988bd49850a37085349da72b90 Mon Sep 17 00:00:00 2001 From: Hans-Christoph Steiner Date: Tue, 27 Sep 2016 12:24:34 +0200 Subject: [PATCH 4/4] update to latest support lib bugfix version: v24.2.1 --- .gitlab-ci.yml | 2 +- app/build.gradle | 28 ++++++++++++++-------------- 2 files changed, 15 insertions(+), 15 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index e50b1203a..5344ba01d 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -1,4 +1,4 @@ -image: mvdan/fdroid-ci:client-20160909 +image: fdroid/ci:client-20160927 cache: paths: diff --git a/app/build.gradle b/app/build.gradle index b6564414f..fc9f9f4b8 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -18,9 +18,9 @@ repositories { } dependencies { - compile 'com.android.support:support-v4:24.2.0' - compile 'com.android.support:appcompat-v7:24.2.0' - compile 'com.android.support:support-annotations:24.2.0' + compile 'com.android.support:support-v4:24.2.1' + compile 'com.android.support:appcompat-v7:24.2.1' + compile 'com.android.support:support-annotations:24.2.1' compile 'com.nostra13.universalimageloader:universal-image-loader:1.9.5' compile 'com.google.zxing:core:3.2.1' @@ -43,7 +43,7 @@ dependencies { testCompile "org.mockito:mockito-core:1.10.19" - androidTestCompile 'com.android.support:support-annotations:24.2.0' + androidTestCompile 'com.android.support:support-annotations:24.2.1' androidTestCompile 'com.android.support.test:runner:0.5' androidTestCompile 'com.android.support.test:rules:0.5' } @@ -87,16 +87,16 @@ if (!hasProperty('sourceDeps')) { 'ch.acra:acra:98e71bd00a713b9f848abbae4874601533aaf8492bf9b508e14d07f844a53839', 'commons-io:commons-io:a10418348d234968600ccb1d988efcbbd08716e1d96936ccc1880e7d22513474', 'commons-net:commons-net:c25b0da668b3c5649f002d504def22d1b4cb30d206f05428d2fe168fa1a901c2', - 'com.android.support:animated-vector-drawable:af39eb9a350084eae2a9e119db762633bbf1ad25eed5305dcc3af2411442ba68', - 'com.android.support:appcompat-v7:29b1e21852ace88ad406bbe32d7791b518118f0a61a61453aca0affa8ef909e0', - 'com.android.support:support-annotations:af5868da6750bdf42aec5d85fa87ac30de2b72939ca80437a6247e5753a07cad', - 'com.android.support:support-compat:de70ac981118229b70ca29961b6df510d6f498c0ececd1e11e19a8073d1580c9', - 'com.android.support:support-core-ui:6cd8723abdeafbd8d05816d7b4a307dd4dbebba9cb145f98e12834ab3ebd9212', - 'com.android.support:support-core-utils:20dd25988a360df5887e8ad5d9cf9b77b54fb014a17163f2125ecde8aa635846', - 'com.android.support:support-fragment:50aa9d408d33b82acda71423ce2980e54186caaae50f689ecd90e6692dcc3ed4', - 'com.android.support:support-media-compat:b6b4ed6dd8e0678bb5fd6457ea9155766cc12d5bc5df9c283c01e0dc782ffb19', - 'com.android.support:support-v4:989888d1b48badd790b8386e9ab61ec793a453ce782faa11e89634d889db3a44', - 'com.android.support:support-vector-drawable:049b53487c07d6270f4b85896c0871645cfb2c6300bbd83f7e5ebf91f069d6a4', + 'com.android.support:animated-vector-drawable:5aa30f578e1daefb26bef0ce06414266fbb4cdf5d4259f42a92c7bd83dcd81b4', + 'com.android.support:appcompat-v7:ead7ac8011fb40676df8adc2856cae934edab55fc4444654c0ac6ea443736088', + 'com.android.support:support-annotations:1e4d471c5378b283d95abfb128e7ed3c6b3cb19bb6f0c317a9b75e48e99365ff', + 'com.android.support:support-compat:8e4fe0078b68073e8f5bcb52aa5b6407fd456d47c51aa0f8e8d1e23c69da06c1', + 'com.android.support:support-core-ui:ecc9184b7f438980e1c4a08b089d62dbc53ff90091f442d91fec27322a02c73c', + 'com.android.support:support-core-utils:0fbc508e41dd6e8c634f310ee88452aaf8f48b6a843a369b115130b80d2fc05f', + 'com.android.support:support-fragment:d8030f0bf0f64214a29dc4e14d5ccd225e59f66ed15eb37f3a5022e773dd1fda', + 'com.android.support:support-media-compat:fa29a23eadd685631584b2c0c624a36e3bb79a33e257b00304501ad682fa2be3', + 'com.android.support:support-v4:cac2956f5c4bb363cc0ba824ac16ea2a687d1c305d434416a34772a5f9375ed7', + 'com.android.support:support-vector-drawable:6ee37a7f7b93c1df1294e6f6f97df3724ac989fcda0549faf677001085330548', 'com.google.zxing:core:b4d82452e7a6bf6ec2698904b332431717ed8f9a850224f295aec89de80f2259', 'com.madgag.spongycastle:core:9b6b7ac856b91bcda2ede694eccd26cefb0bf0b09b89f13cda05b5da5ff68c6b', 'com.madgag.spongycastle:pkix:6aba9b2210907a3d46dd3dcac782bb3424185290468d102d5207ebdc9796a905',