ci(android): build the APK+AAR on android/, src/ and crates/ changes #71

Merged
sirius merged 1 commit from ci/android-verify into main 2026-09-14 16:25:55 +00:00
Owner

Android changes ran zero CI. ci.yml's path allowlist (src/**, crates/**, tests/**, Cargo.toml, Cargo.lock, ci.yml) cannot match android/**, and android-release.yml is dispatch-driven — so #70 (3 Kotlin files, 198 +/41 −) had no run at all and merged on an empty check list. missing run is not a merge trap only holds because Rust changes still ran; an android regression had nothing watching it.

What this adds

.forgejo/workflows/android-ci.yml — one job on the docker-amd64 runner that runs the same gradle targets the release runs, through the same script (scripts/build-android-local.sh): :sdk:assembleRelease + :app:assembleRelease, Rust for aarch64-linux-android via cargo-ndk, the UniFFI bindings, then packaging. So a Kotlin compile break — nav.navigate("wallet") with no destination, a call site missing onOpenWallet, a stale self.inner.* — fails the PR instead of the tag.

Verification inside the job: packaged lib/arm64-v8a/libonionwire_sdk.so present in the APK, classes*.dex, sha256sum -c on both artifacts, apksigner verify --print-certs, aapt dump badging.

Differences from a release, all deliberate:

  • Debug key. ONIONWIRE_REQUIRE_RELEASE_KEY=false and no keystore, so Gradle falls back to the debug cert. Expected output in this job; android-release.yml still fails closed with the release key.
  • Nothing is published, no tag is touched.
  • It shares android-release.yml's concurrency group (onionwire-android-release-v2) and its four runner volumes (SDK/NDK, cargo registry, cargo target, Gradle). The build is warm (~9 min, matching the release job's recent runs) instead of re-downloading a gigabyte of SDK + NDK, and the two workflows are serialized so they never write each other's volumes. Container name uses a distinct onionwire-android-ci-<run_id> prefix.

Triggers: push: main and pull_request when android/**, src/**, crates/**, Cargo.toml, Cargo.lock, scripts/build-android-local.sh or the workflow change; plus workflow_dispatch. src/** and crates/** are in the list on purpose — a core or SDK signature change is what breaks the APK (the E0609: no field inner on type &Wire class).

Why not android/** in ci.yml's paths

Added there, an android-only diff would start test + sdk on the Pi — cargo work that proves nothing about Kotlin — and would still not build the app, i.e. a green check for the wrong suite. The alternative, job-level "did the diff touch android/?" gates inside ci.yml, means a mis-detecting gate can skip the Rust suite and hand out a false green on main. A separate workflow keeps ci.yml's Rust semantics and path allowlist exactly as they are and lets the runner's own paths filter decide.

Docs: README workflow list + a short "Android CI (not a release)" note in docs/RELEASING.md.

CI on this PR

android-ci runs on this PR head (the workflow file itself matches the filter). The expected-result section below is filled from that run.

Android changes ran **zero** CI. `ci.yml`'s path allowlist (`src/**`, `crates/**`, `tests/**`, `Cargo.toml`, `Cargo.lock`, `ci.yml`) cannot match `android/**`, and `android-release.yml` is dispatch-driven — so #70 (3 Kotlin files, 198 +/41 −) had no run at all and merged on an empty check list. `missing run is not a merge trap` only holds because Rust changes still ran; an android regression had nothing watching it. ## What this adds `.forgejo/workflows/android-ci.yml` — one job on the `docker-amd64` runner that runs the **same gradle targets the release runs**, through the **same script** (`scripts/build-android-local.sh`): `:sdk:assembleRelease` + `:app:assembleRelease`, Rust for `aarch64-linux-android` via `cargo-ndk`, the UniFFI bindings, then packaging. So a Kotlin compile break — `nav.navigate("wallet")` with no destination, a call site missing `onOpenWallet`, a stale `self.inner.*` — fails the PR instead of the tag. Verification inside the job: packaged `lib/arm64-v8a/libonionwire_sdk.so` present in the APK, `classes*.dex`, `sha256sum -c` on both artifacts, `apksigner verify --print-certs`, `aapt dump badging`. Differences from a release, all deliberate: * **Debug key.** `ONIONWIRE_REQUIRE_RELEASE_KEY=false` and no keystore, so Gradle falls back to the debug cert. Expected output in this job; `android-release.yml` still fails closed with the release key. * **Nothing is published, no tag is touched.** * It shares `android-release.yml`'s **concurrency group** (`onionwire-android-release-v2`) and its four runner volumes (SDK/NDK, cargo registry, cargo target, Gradle). The build is warm (~9 min, matching the release job's recent runs) instead of re-downloading a gigabyte of SDK + NDK, and the two workflows are serialized so they never write each other's volumes. Container name uses a distinct `onionwire-android-ci-<run_id>` prefix. Triggers: `push: main` and `pull_request` when `android/**`, `src/**`, `crates/**`, `Cargo.toml`, `Cargo.lock`, `scripts/build-android-local.sh` or the workflow change; plus `workflow_dispatch`. `src/**` and `crates/**` are in the list on purpose — a core or SDK signature change is what breaks the APK (the `E0609: no field inner on type &Wire` class). ## Why not `android/**` in `ci.yml`'s `paths` Added there, an android-only diff would start `test` + `sdk` on the Pi — cargo work that proves nothing about Kotlin — and would *still* not build the app, i.e. a green check for the wrong suite. The alternative, job-level "did the diff touch `android/`?" gates inside `ci.yml`, means a mis-detecting gate can skip the Rust suite and hand out a false green on `main`. A separate workflow keeps `ci.yml`'s Rust semantics and path allowlist exactly as they are and lets the runner's own paths filter decide. Docs: README workflow list + a short "Android CI (not a release)" note in `docs/RELEASING.md`. ## CI on this PR `android-ci` runs on this PR head (the workflow file itself matches the filter). The expected-result section below is filled from that run.
ci(android): build the APK+AAR on android/, src/ and crates/ changes
All checks were successful
android-ci / android (pull_request) Successful in 9m30s
ef1248e730
An android-only PR ran zero jobs: ci.yml's path allowlist never matches
android/**, and android-release.yml is dispatch-driven. #70 merged on an
empty check list.

android-ci.yml runs the release's gradle targets through the release's own
script (scripts/build-android-local.sh) on the amd64 runner, debug-signed,
publishing nothing. Same concurrency group and runner volumes as
android-release.yml so the build is warm and cannot collide with a release.
sirius merged commit 8e97b12f73 into main 2026-09-14 16:25:55 +00:00
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
sirius/onionwire!71
No description provided.