From 26e3f8db490881cd348f818b2a3f3b3e91ef1525 Mon Sep 17 00:00:00 2001 From: emmaoke-w Date: Thu, 5 Feb 2026 11:44:50 +0100 Subject: [PATCH 1/6] setup Java and adb in runner health check --- .github/workflows/qa-runner-health-check.yml | 61 +++++++++++++------- 1 file changed, 39 insertions(+), 22 deletions(-) diff --git a/.github/workflows/qa-runner-health-check.yml b/.github/workflows/qa-runner-health-check.yml index 55e01abfa4e..428dbf969b2 100644 --- a/.github/workflows/qa-runner-health-check.yml +++ b/.github/workflows/qa-runner-health-check.yml @@ -14,36 +14,53 @@ jobs: timeout-minutes: 10 steps: - - name: Checkout repository + - name: Checkout uses: actions/checkout@v4 - - name: Show system info - run: | - echo "Runner hostname: $(hostname)" - echo "User:" - whoami - echo "OS:" - uname -a - echo "Disk usage:" - df -h - echo "Memory:" - free -h || true - echo "Java:" - java -version || true - echo "Gradle:" - ./gradlew -v || true - - - name: Verify ADB + - name: Setup Java 17 + uses: buildjet/setup-java@v4 + with: + java-version: "17" + distribution: "temurin" + + - name: Setup ADB (no sudo) run: | + set -e + + # If adb already exists, use it + if command -v adb >/dev/null 2>&1; then + echo "adb already available" + adb version + exit 0 + fi + + # Otherwise download Android platform-tools (contains adb) + echo "Downloading Android platform-tools..." + mkdir -p "$HOME/platform-tools" + cd "$HOME/platform-tools" + + curl -L -o platform-tools.zip https://dl.google.com/android/repository/platform-tools-latest-linux.zip + unzip -q platform-tools.zip + + # Add adb to PATH for the rest of this workflow + echo "$HOME/platform-tools/platform-tools" >> "$GITHUB_PATH" + adb version + + - name: Check connected Android devices + run: | + set -e adb start-server adb devices -l - - name: Fail if no Android devices connected - run: | COUNT=$(adb devices | awk 'NR>1 && $2=="device"{print $1}' | wc -l | tr -d ' ') - echo "Connected devices: $COUNT" + echo "Authorized devices detected: $COUNT" + if [ "$COUNT" -eq 0 ]; then - echo "ERROR: No Android devices detected by adb" + echo "ERROR: No authorized Android devices detected." + echo "Common causes:" + echo "- No phone connected to the runner USB hub" + echo "- Phone is 'unauthorized' (unlock and accept USB debugging prompt)" + echo "- USB mode/cable issue" exit 1 fi From 99de51c38837f68510feed9ab254663e6be3e840 Mon Sep 17 00:00:00 2001 From: emmaoke-w Date: Thu, 5 Feb 2026 12:59:24 +0100 Subject: [PATCH 2/6] fix: correct adb PATH handling in runner health check --- .github/workflows/qa-runner-health-check.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/qa-runner-health-check.yml b/.github/workflows/qa-runner-health-check.yml index 428dbf969b2..488cd35acf4 100644 --- a/.github/workflows/qa-runner-health-check.yml +++ b/.github/workflows/qa-runner-health-check.yml @@ -45,11 +45,11 @@ jobs: # Add adb to PATH for the rest of this workflow echo "$HOME/platform-tools/platform-tools" >> "$GITHUB_PATH" - adb version - name: Check connected Android devices run: | set -e + adb version adb start-server adb devices -l From 52634bff876eb269fc905c43fb6013d87714bb55 Mon Sep 17 00:00:00 2001 From: emmaoke-w Date: Fri, 6 Feb 2026 11:30:00 +0100 Subject: [PATCH 3/6] update script --- .github/workflows/qa-runner-health-check.yml | 26 ++++++++------------ 1 file changed, 10 insertions(+), 16 deletions(-) diff --git a/.github/workflows/qa-runner-health-check.yml b/.github/workflows/qa-runner-health-check.yml index 488cd35acf4..ff874e62ea6 100644 --- a/.github/workflows/qa-runner-health-check.yml +++ b/.github/workflows/qa-runner-health-check.yml @@ -27,31 +27,25 @@ jobs: run: | set -e - # If adb already exists, use it if command -v adb >/dev/null 2>&1; then echo "adb already available" adb version - exit 0 + else + echo "Downloading Android platform-tools..." + cd "$HOME" + curl -L -o platform-tools.zip https://dl.google.com/android/repository/platform-tools-latest-linux.zip + unzip -oq platform-tools.zip + echo "$HOME/platform-tools" >> "$GITHUB_PATH" + adb version fi - # Otherwise download Android platform-tools (contains adb) - echo "Downloading Android platform-tools..." - mkdir -p "$HOME/platform-tools" - cd "$HOME/platform-tools" - - curl -L -o platform-tools.zip https://dl.google.com/android/repository/platform-tools-latest-linux.zip - unzip -q platform-tools.zip - - # Add adb to PATH for the rest of this workflow - echo "$HOME/platform-tools/platform-tools" >> "$GITHUB_PATH" - - - name: Check connected Android devices run: | set -e - adb version adb start-server - adb devices -l + + echo "=== adb devices -l ===" + adb devices -l || true COUNT=$(adb devices | awk 'NR>1 && $2=="device"{print $1}' | wc -l | tr -d ' ') echo "Authorized devices detected: $COUNT" From d6e34e546b722eeeb49385468e81e19012fd9ea2 Mon Sep 17 00:00:00 2001 From: emmaoke-w Date: Fri, 6 Feb 2026 11:41:45 +0100 Subject: [PATCH 4/6] update --- .github/workflows/qa-runner-health-check.yml | 49 ++++++++++++++------ kalium | 2 +- 2 files changed, 37 insertions(+), 14 deletions(-) diff --git a/.github/workflows/qa-runner-health-check.yml b/.github/workflows/qa-runner-health-check.yml index ff874e62ea6..2133132dc1a 100644 --- a/.github/workflows/qa-runner-health-check.yml +++ b/.github/workflows/qa-runner-health-check.yml @@ -24,28 +24,51 @@ jobs: distribution: "temurin" - name: Setup ADB (no sudo) + shell: bash run: | - set -e + set -euo pipefail if command -v adb >/dev/null 2>&1; then - echo "adb already available" - adb version - else - echo "Downloading Android platform-tools..." - cd "$HOME" - curl -L -o platform-tools.zip https://dl.google.com/android/repository/platform-tools-latest-linux.zip - unzip -oq platform-tools.zip - echo "$HOME/platform-tools" >> "$GITHUB_PATH" + echo "adb already available: $(command -v adb)" adb version + exit 0 fi + TOOLS_DIR="$HOME/android-platform-tools" + ADB_DIR="$TOOLS_DIR/platform-tools" + ADB_BIN="$ADB_DIR/adb" + + echo "Downloading Android platform-tools to $TOOLS_DIR" + mkdir -p "$TOOLS_DIR" + cd "$TOOLS_DIR" + + curl -fsSL -o platform-tools.zip https://dl.google.com/android/repository/platform-tools-latest-linux.zip + unzip -oq platform-tools.zip + + # Make sure adb exists where we expect it + if [ ! -x "$ADB_BIN" ]; then + echo "ERROR: adb not found at $ADB_BIN" + echo "Contents of $TOOLS_DIR:" + ls -la "$TOOLS_DIR" || true + echo "Contents of $ADB_DIR:" + ls -la "$ADB_DIR" || true + exit 1 + fi + + # Add to PATH for subsequent steps + echo "$ADB_DIR" >> "$GITHUB_PATH" + + # Verify in THIS step using full path (PATH update may not apply yet) + "$ADB_BIN" version + - name: Check connected Android devices + shell: bash run: | - set -e - adb start-server + set -euo pipefail - echo "=== adb devices -l ===" - adb devices -l || true + adb version + adb start-server + adb devices -l COUNT=$(adb devices | awk 'NR>1 && $2=="device"{print $1}' | wc -l | tr -d ' ') echo "Authorized devices detected: $COUNT" diff --git a/kalium b/kalium index 0ac7c385b7d..ae71a9a75ae 160000 --- a/kalium +++ b/kalium @@ -1 +1 @@ -Subproject commit 0ac7c385b7dbbf9334125ff4eae9636d212134ad +Subproject commit ae71a9a75ae63027c8970905ef5bdeabc59fee8b From ebee673e4c4d8fa0ca73c48b0f5272cda31febba Mon Sep 17 00:00:00 2001 From: emmaoke-w Date: Fri, 6 Feb 2026 12:06:17 +0100 Subject: [PATCH 5/6] update --- .github/workflows/qa-runner-health-check.yml | 62 ++++++++++---------- 1 file changed, 32 insertions(+), 30 deletions(-) diff --git a/.github/workflows/qa-runner-health-check.yml b/.github/workflows/qa-runner-health-check.yml index 2133132dc1a..24049b0dbea 100644 --- a/.github/workflows/qa-runner-health-check.yml +++ b/.github/workflows/qa-runner-health-check.yml @@ -5,11 +5,13 @@ on: jobs: health-check: + name: Health check (qa-runner-01) runs-on: - self-hosted - Linux - X64 - office + - qa-runner-01 timeout-minutes: 10 @@ -23,7 +25,7 @@ jobs: java-version: "17" distribution: "temurin" - - name: Setup ADB (no sudo) + - name: Ensure ADB is available (no sudo) shell: bash run: | set -euo pipefail @@ -34,34 +36,22 @@ jobs: exit 0 fi - TOOLS_DIR="$HOME/android-platform-tools" - ADB_DIR="$TOOLS_DIR/platform-tools" - ADB_BIN="$ADB_DIR/adb" + echo "adb not found. Installing Android platform-tools locally..." + cd "$HOME" - echo "Downloading Android platform-tools to $TOOLS_DIR" - mkdir -p "$TOOLS_DIR" - cd "$TOOLS_DIR" + rm -rf platform-tools platform-tools.zip + curl -fsSL -o platform-tools.zip \ + https://dl.google.com/android/repository/platform-tools-latest-linux.zip - curl -fsSL -o platform-tools.zip https://dl.google.com/android/repository/platform-tools-latest-linux.zip unzip -oq platform-tools.zip - # Make sure adb exists where we expect it - if [ ! -x "$ADB_BIN" ]; then - echo "ERROR: adb not found at $ADB_BIN" - echo "Contents of $TOOLS_DIR:" - ls -la "$TOOLS_DIR" || true - echo "Contents of $ADB_DIR:" - ls -la "$ADB_DIR" || true - exit 1 - fi + # Make adb available for subsequent steps + echo "$HOME/platform-tools" >> "$GITHUB_PATH" - # Add to PATH for subsequent steps - echo "$ADB_DIR" >> "$GITHUB_PATH" + # Sanity check + "$HOME/platform-tools/adb" version - # Verify in THIS step using full path (PATH update may not apply yet) - "$ADB_BIN" version - - - name: Check connected Android devices + - name: Check connected Android devices (must be authorized) shell: bash run: | set -euo pipefail @@ -70,14 +60,26 @@ jobs: adb start-server adb devices -l - COUNT=$(adb devices | awk 'NR>1 && $2=="device"{print $1}' | wc -l | tr -d ' ') - echo "Authorized devices detected: $COUNT" + AUTHORIZED_COUNT=$(adb devices | awk 'NR>1 && $2=="device"{print $1}' | wc -l | tr -d ' ') + UNAUTHORIZED_COUNT=$(adb devices | awk 'NR>1 && $2=="unauthorized"{print $1}' | wc -l | tr -d ' ') + OFFLINE_COUNT=$(adb devices | awk 'NR>1 && $2=="offline"{print $1}' | wc -l | tr -d ' ') + + echo "Authorized devices: $AUTHORIZED_COUNT" + echo "Unauthorized devices: $UNAUTHORIZED_COUNT" + echo "Offline devices: $OFFLINE_COUNT" - if [ "$COUNT" -eq 0 ]; then + if [ "$AUTHORIZED_COUNT" -eq 0 ]; then echo "ERROR: No authorized Android devices detected." - echo "Common causes:" - echo "- No phone connected to the runner USB hub" - echo "- Phone is 'unauthorized' (unlock and accept USB debugging prompt)" - echo "- USB mode/cable issue" + echo "If devices are connected but show as 'unauthorized':" + echo " - unlock the phone" + echo " - accept the 'Allow USB debugging' prompt" + echo " - optionally toggle USB debugging off/on" exit 1 fi + + - name: Runner identity (for audit) + shell: bash + run: | + echo "Runner hostname: $(hostname)" + echo "User: $(whoami)" + uname -a From 0698bd311e444d2e59d5db302def9c88a107f9e5 Mon Sep 17 00:00:00 2001 From: emmaoke-w Date: Fri, 6 Feb 2026 16:40:40 +0100 Subject: [PATCH 6/6] label updated --- .github/workflows/qa-runner-health-check.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/qa-runner-health-check.yml b/.github/workflows/qa-runner-health-check.yml index 24049b0dbea..85a0ec1da63 100644 --- a/.github/workflows/qa-runner-health-check.yml +++ b/.github/workflows/qa-runner-health-check.yml @@ -11,7 +11,7 @@ jobs: - Linux - X64 - office - - qa-runner-01 + - android-qa timeout-minutes: 10