AndroidBLEDemo/.gitlab-ci.yml

43 lines
1.2 KiB
YAML

image: eclipse-temurin:17-jdk
variables:
ANDROID_COMPILE_SDK: "34"
ANDROID_BUILD_TOOLS: "34.0.0"
ANDROID_SDK_TOOLS: "10406996"
before_script:
- apt update
- apt install -y wget tar unzip bash
- mkdir -p android-sdk-linux/cmdline-tools/latest
- wget --quiet --output-document=cmdline-tools.zip https://dl.google.com/android/repository/commandlinetools-linux-${ANDROID_SDK_TOOLS}_latest.zip
- unzip -d android-sdk-linux/cmdline-tools/latest cmdline-tools.zip
- mv android-sdk-linux/cmdline-tools/latest/cmdline-tools/* android-sdk-linux/cmdline-tools/latest
- export ANDROID_HOME=$PWD/android-sdk-linux
- export PATH=$PATH:$PWD/android-sdk-linux/cmdline-tools/latest/bin
- echo y | sdkmanager --licenses
- echo y | sdkmanager "platforms;android-${ANDROID_COMPILE_SDK}"
- echo y | sdkmanager "platform-tools"
- echo y | sdkmanager "build-tools;${ANDROID_BUILD_TOOLS}"
- chmod +x ./gradlew
stages:
- build
- test
lintDebug:
stage: build
script:
- ./gradlew -Pci --console=plain :app:lintDebug -PbuildDir=lint
assembleDebug:
stage: build
script:
- ./gradlew assembleDebug
artifacts:
paths:
- app/build/outputs/
debugTests:
stage: test
script:
- ./gradlew -Pci --console=plain :app:testDebug