From 6b954872946abef3bfa5b526c8be0b0980b0ef0d Mon Sep 17 00:00:00 2001 From: xodapi <4956501+xodapi@users.noreply.github.com> Date: Sat, 4 Jul 2026 10:36:18 +0700 Subject: [PATCH] ci(android): add target library check (closes #121) --- .github/workflows/ci.yml | 26 ++++++++++++++++++++++++++ docs/android.md | 13 +++++++++++++ 2 files changed, 39 insertions(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 927cfff..9c1bf93 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -6,6 +6,7 @@ on: env: CARGO_TERM_COLOR: always + ANDROID_NDK_VERSION: "27.0.12077973" jobs: check: @@ -46,3 +47,28 @@ jobs: run: cargo run --locked -- --demo --json - name: Run fixture CLI run: cargo run --locked -- --mock tests/fixtures/me.json + + android-lib-check: + name: Android library check + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - name: Install Linux GUI dependencies + run: | + sudo apt-get update + sudo apt-get install -y libfontconfig1-dev libxkbcommon-dev + - uses: android-actions/setup-android@v3 + - name: Install Android SDK packages + run: | + sdkmanager \ + "platforms;android-35" \ + "ndk;${ANDROID_NDK_VERSION}" + echo "ANDROID_NDK_HOME=${ANDROID_HOME}/ndk/${ANDROID_NDK_VERSION}" >> "$GITHUB_ENV" + echo "ANDROID_NDK_ROOT=${ANDROID_HOME}/ndk/${ANDROID_NDK_VERSION}" >> "$GITHUB_ENV" + echo "CC_aarch64_linux_android=${ANDROID_HOME}/ndk/${ANDROID_NDK_VERSION}/toolchains/llvm/prebuilt/linux-x86_64/bin/aarch64-linux-android35-clang" >> "$GITHUB_ENV" + echo "AR_aarch64_linux_android=${ANDROID_HOME}/ndk/${ANDROID_NDK_VERSION}/toolchains/llvm/prebuilt/linux-x86_64/bin/llvm-ar" >> "$GITHUB_ENV" + echo "CARGO_TARGET_AARCH64_LINUX_ANDROID_LINKER=${ANDROID_HOME}/ndk/${ANDROID_NDK_VERSION}/toolchains/llvm/prebuilt/linux-x86_64/bin/aarch64-linux-android35-clang" >> "$GITHUB_ENV" + - name: Install Rust Android target + run: rustup target add aarch64-linux-android + - name: Check Android-gated library + run: cargo check --locked --features android-gui --target aarch64-linux-android --lib diff --git a/docs/android.md b/docs/android.md index 12ba687..389fff4 100644 --- a/docs/android.md +++ b/docs/android.md @@ -90,6 +90,19 @@ work. This is intentionally not a GitHub Release. Release tags and production release assets stay under the existing release workflow. +## CI Android library check + +The main CI workflow installs the `aarch64-linux-android` Rust target and runs: + +```bash +cargo check --locked --features android-gui --target aarch64-linux-android --lib +``` + +This is a fast compile guard for Android-gated Rust code. It does not install +or run the APK, does not require API keys, and does not replace the manual APK +artifact/device test above. Use the `Android Test APK` workflow when a change +needs manifest, packaging, or real-device validation. + ## Agent burn alerts The Android build declares `INTERNET`, `VIBRATE`, and `POST_NOTIFICATIONS`.