From 69f6560ba8c8ab653ef153131e4c52ab8973b744 Mon Sep 17 00:00:00 2001 From: Hans-Christoph Steiner Date: Fri, 12 Jan 2018 13:50:28 +0100 Subject: [PATCH] gitlab-ci: replace clbin uploads with GitLab CI Artifacts This gathers all files that are not tracked by git into a named ZIP file, which is available for 1 week to download from the Pipelines page for the fork that ran the build. --- .gitlab-ci.yml | 51 +++++++++++++++++++------------------------------- 1 file changed, 19 insertions(+), 32 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index e9850e8f7..607906508 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -14,8 +14,22 @@ before_script: - 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} +.test-template: &test-template + artifacts: + name: "${CI_PROJECT_PATH}_${CI_JOB_STAGE}_${CI_COMMIT_REF_NAME}_${CI_COMMIT_SHA}" + paths: + - logcat.txt + - app/build/reports + - app/build/outputs/*ml + - app/build/outputs/apk + expire_in: 1 week + when: on_failure + after_script: + - echo "Download debug artifacts from https://gitlab.com/${CI_PROJECT_PATH}/-/jobs" + test: stage: test + <<: *test-template script: - export EXITVALUE=0 - ./tools/check-format-strings.py @@ -28,17 +42,12 @@ test: - ./gradlew lint - ./gradlew pmd - ./gradlew checkstyle - - ./gradlew test || { - for log in app/build/reports/*ests/*/*ml; do - echo "read $log here:"; - (cat "$log" | curl --silent -F 'clbin=<-' https://clbin.com) || true; - done; - export EXITVALUE=1; - } + - ./gradlew test || export EXITVALUE=1 - exit $EXITVALUE connected10: stage: test + <<: *test-template variables: AVD_SDK: "10" script: @@ -46,23 +55,13 @@ connected10: - 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 || { - adb -e logcat -d '*:E'; - echo "get the full logcat here:"; - (adb -e logcat -d | curl --silent -F 'clbin=<-' https://clbin.com) || true; - 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) || true; - done + - ./gradlew connectedCheck || adb -e logcat -d '*:E' > logcat.txt connected24: stage: test variables: AVD_SDK: "24" + <<: *test-template script: - ./gradlew assembleDebug - android list avd @@ -70,19 +69,7 @@ connected24: - ./tools/wait-for-emulator - adb shell input keyevent 82 & - adb devices - - export EXITVALUE=0 - - ./gradlew connectedCheck || { - adb -e logcat -d '*:E'; - echo "get the full logcat here:"; - (adb -e logcat -d | curl --silent -F 'clbin=<-' https://clbin.com) || true; - 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) || true; - done - - exit $EXITVALUE + - ./gradlew connectedCheck || adb -e logcat -d '*:E' > logcat.txt deploy_nightly: stage: deploy