From 8d5f1da32081a85441e3ca3c873fa6d0903fbd9d Mon Sep 17 00:00:00 2001 From: Distopico Vegan Date: Fri, 9 Nov 2018 11:56:04 -0500 Subject: [PATCH] add CI config --- .gitlab-ci.yml | 84 ++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 84 insertions(+) create mode 100644 .gitlab-ci.yml diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml new file mode 100644 index 00000000..9e7e35b7 --- /dev/null +++ b/.gitlab-ci.yml @@ -0,0 +1,84 @@ +image: openjdk:8-jdk + +stages: + - build + - test + - deploy + +variables: + ANDROID_COMPILE_SDK: egrep '^[[:blank:]]+compileSdkVersion' app/build.gradle | awk '{print $2}' + +before_script: + #- apt-get --quiet update --yes + #- apt-get --quiet install --yes wget tar unzip lib32stdc++6 lib32z1 + # Explict output for logging purpose only + - echo $ANDROID_SDK_TOOLS + - echo $ANDROID_COMPILE_SDK + # Fetch the specified SDK tools version to build with + - wget --quiet --output-document=android-sdk.zip https://dl.google.com/android/repository/sdk-tools-linux-${ANDROID_SDK_TOOLS}.zip + - unzip -d android-sdk android-sdk.zip + # Install platform tools and Android SDK for the compile target + - echo y | android-sdk/tools/bin/sdkmanager "platforms;android-${ANDROID_COMPILE_SDK}" >/dev/null + #- echo y | android-sdk/tools/bin/sdkmanager "platform-tools" >/dev/null + #- echo y | android-sdk/tools/bin/sdkmanager "build-tools;${ANDROID_BUILD_TOOLS}" >/dev/null + # Adds to environment path + - export ANDROID_HOME=$PWD/android-sdk + - export PATH=$PATH:$PWD/android-sdk/platform-tools/ + - chmod +x ./gradlew + # temporarily disable checking for EPIPE error and use yes to accept all licenses + #- set +o pipefail + #- yes | android-sdk/tools/bin/sdkmanager --licenses + #- set -o pipefail + +artifacts: + expire_in: 1 week + paths: + - app/build/outputs/ + +lintAll: + stage: test + except: + - master + script: + - ./gradlew --console=plain lint + +lintRelease: + stage: test + only: + - master + script: + - ./gradlew --console=plain lintRelease + +testAll: + stage: test + except: + - master + script: + - ./gradlew --console=plain test + +testRelease: + stage: test + only: + - master + script: + - ./gradlew --console=plain testReleaseUnitTest + +buildDebug: + stage: build + except: + - master + script: + - ./gradlew assembleDebug + +buildRelease: + stage: build + only: + - master + script: + - ./gradlew assembleRelease + +release: + image: "aplyca/semantic-release" + stage: deploy + script: + - semantic-release --help