Add GitLab CI config

This commit is contained in:
Andrew 2023-02-28 21:08:51 +07:00
parent 387f10b920
commit 1bb232e75b

45
.gitlab-ci.yml Normal file
View file

@ -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/