[network/kdeconnect-android] /: Simplify CI script

Albert Vaca Cintora <[email protected]>
Newsgroups gmane.comp.kde.cvs
Message-ID <[email protected]>
Git commit ff998d826f411c905cd7a7b8ad709779f9872c96 by Albert Vaca Cintora.
Committed on 07/08/2026 at 18:10.
Pushed by albertvaka into branch 'master'.

Simplify CI script

M  +9    -25   .gitlab-ci.yml

https://invent.kde.org/network/kdeconnect-android/-/commit/ff998d826f411c905cd7a7b8ad709779f9872c96

diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index 7e255fcd2..4d94aa592 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -5,44 +5,27 @@
 # Test this pipeline locally by:
 # - Set up Docker on your machine, if not already set up
 # - Set up gitlab-runner, as described here: https://stackoverflow.com/a/52724374
-# - Run `gitlab-runner exec docker --docker-privileged assembleDebug`
+# - Run `gitlab-runner exec docker --docker-privileged buildLintAndTest`
 
 variables:
-  ANDROID_COMPILE_SDK: "33"
-  ANDROID_BUILD_TOOLS: "34.0.0"
-  ANDROID_SDK_TOOLS:   "10406996"
+  ANDROID_SDK_TOOLS:   "15859902" // Version from https://developer.android.com/studio#command-line-tools-only
 
 default:
   tags:
     - Linux
-  image: ubuntu:22.04
+  image: ubuntu:26.04
   before_script:
-    # Prepare system for use of sdkmanager
+    # Install Java and Android SDK
     - apt-get --quiet update --yes
-    - apt-get --quiet install --yes wget tar unzip lib32stdc++6 lib32z1 openjdk-17-jdk-headless
-    - wget --quiet --output-document=android-sdk.zip https://dl.google.com/android/repository/commandlinetools-linux-10406996_latest.zip
-    # Create the directory structure around cmdline-tools that sdkmanager is expecting
+    - apt-get --quiet install --yes wget tar unzip openjdk-21-jdk-headless
+    - wget --no-verbose -O android-sdk.zip "https://dl.google.com/android/repository/commandlinetools-linux-${ANDROID_SDK_TOOLS}_latest.zip"
+    # Create ANDROID_HOME structure
     - mkdir -p sdk/cmdline-tools
     - unzip android-sdk.zip
     - mv cmdline-tools sdk/cmdline-tools/latest
-    # Update the environment
     - export ANDROID_HOME=$PWD/sdk
     - export PATH=$PATH:$PWD/sdk/cmdline-tools/latest/bin
-    # (this line should fail if sdkmanager is moved out of that directory in the future)
-    - type sdkmanager
-    # Install SDK packages
-    - echo y | sdkmanager "platforms;android-${ANDROID_COMPILE_SDK}" >/dev/null
-    - echo y | sdkmanager "platform-tools" >/dev/null
-    - echo y | sdkmanager "emulator" >/dev/null
-    - echo y | sdkmanager "platform-tools" >/dev/null
-    - echo y | sdkmanager "tools" >/dev/null
-    - echo y | sdkmanager "build-tools;${ANDROID_BUILD_TOOLS}" >/dev/null
-    # temporarily disable checking for EPIPE error and use yes to accept all licenses
-    - set +o pipefail
-    - yes | sdkmanager --licenses
-    # Re-enable checking for EPIPE and allow execution of Gradle wrapper script
-    - set -o pipefail
-    - chmod +x ./gradlew
+    - (yes || true) | sdkmanager --licenses
 
 stages:
   - buildLintAndTest
@@ -50,6 +33,7 @@ stages:
 buildLintAndTest:
   stage: buildLintAndTest
   script:
+    - chmod +x ./gradlew
     - ./gradlew assembleDebug
     - ./gradlew -Pci --console=plain lintDebug -PbuildDir=lint
     - ./gradlew -Pci --console=plain testDebug
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.