AndroidBLEDemo/.gitlab-ci.yml

44 lines
1.2 KiB
YAML
Raw Permalink Normal View History

2024-01-08 11:08:33 +00:00
image: eclipse-temurin:17-jdk
2024-01-08 08:31:15 +00:00
2024-01-08 10:41:34 +00:00
variables:
ANDROID_COMPILE_SDK: "34"
2024-01-08 10:44:59 +00:00
ANDROID_BUILD_TOOLS: "34.0.0"
ANDROID_SDK_TOOLS: "10406996"
2024-01-08 10:41:34 +00:00
before_script:
2024-01-08 11:11:29 +00:00
- apt update
2024-01-08 11:12:17 +00:00
- apt install -y wget tar unzip bash
2024-01-08 11:17:12 +00:00
- 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
2024-01-08 10:41:34 +00:00
- export ANDROID_HOME=$PWD/android-sdk-linux
2024-01-08 11:17:12 +00:00
- 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}"
2024-01-08 10:41:34 +00:00
- chmod +x ./gradlew
2024-01-08 08:31:15 +00:00
stages:
- build
2024-01-08 10:41:34 +00:00
- test
2024-01-08 08:31:15 +00:00
2024-01-08 10:41:34 +00:00
lintDebug:
stage: build
script:
- ./gradlew -Pci --console=plain :app:lintDebug -PbuildDir=lint
2024-01-08 08:31:15 +00:00
2024-01-08 10:41:34 +00:00
assembleDebug:
2024-01-08 08:31:15 +00:00
stage: build
script:
- ./gradlew assembleDebug
artifacts:
paths:
2024-01-08 10:41:34 +00:00
- app/build/outputs/
debugTests:
stage: test
script:
- ./gradlew -Pci --console=plain :app:testDebug