From 1bb232e75b576766031ed7de8ec45617a3414279 Mon Sep 17 00:00:00 2001 From: Andrew nuark G Date: Tue, 28 Feb 2023 21:08:51 +0700 Subject: [PATCH] Add GitLab CI config --- .gitlab-ci.yml | 45 +++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 45 insertions(+) create mode 100644 .gitlab-ci.yml diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml new file mode 100644 index 0000000..d1b8b34 --- /dev/null +++ b/.gitlab-ci.yml @@ -0,0 +1,45 @@ +image: openjdk:11-jdk + +variables: + ANDROID_COMPILE_SDK: "33" + ANDROID_BUILD_TOOLS: "33.0.3" + ANDROID_SDK_TOOLS: "9477386" + +before_script: + - apt-get --quiet update --yes + - apt-get --quiet install --yes wget tar unzip lib32stdc++6 lib32z1 + + - export ANDROID_HOME="${PWD}/android-home" + - install -d $ANDROID_HOME + - wget --output-document=$ANDROID_HOME/cmdline-tools.zip https://dl.google.com/android/repository/commandlinetools-linux-${ANDROID_SDK_TOOLS}_latest.zip + - pushd $ANDROID_HOME + - unzip -d cmdline-tools cmdline-tools.zip + - pushd cmdline-tools + - mv cmdline-tools tools || true + - popd + - popd + - export PATH=$PATH:${ANDROID_HOME}/cmdline-tools/tools/bin/ + + - sdkmanager --version + + - yes | sdkmanager --licenses || true + - sdkmanager "platforms;android-${ANDROID_COMPILE_SDK}" + - sdkmanager "platform-tools" + - sdkmanager "build-tools;${ANDROID_BUILD_TOOLS}" + + - chmod +x ./gradlew + +lintDebug: + interruptible: true + stage: build + script: + - ./gradlew -Pci --console=plain :app:lintDebug -PbuildDir=lint + +assembleDebug: + interruptible: true + stage: build + script: + - ./gradlew assembleDebug + artifacts: + paths: + - app/build/outputs/ \ No newline at end of file