ci: shave another ~80s off lint/lsposed jobs

Profiling the warm-cache run on PR #105 showed three remaining hot spots
in the Gradle phase:

  installUniffiBindgen          52s   ← cargo install on every CI build
  cargoBuildAndroidArm64Debug   30s   ← Rust crate compile
  lintAnalyze* (3 variants)     43s   ← AGP Lint × main + unit + androidTest

This PR cuts the first one entirely and trims the third.

  - Dockerfile: pre-install uniffi-bindgen 0.29.x in the CI image so
    Gobley's :app:installUniffiBindgen task finds it ready instead of
    rebuilding it from sources on every run. Triggers a ci-image
    rebuild on merge — wait for that workflow to finish before merging
    consumers (or the first lint/lsposed run will still hit the old
    image and behave as before).
  - lsposed/gradle.properties: enable build cache + configuration
    cache. Verified locally: `./gradlew :app:assembleDebug
    --configuration-cache` reports "Configuration cache entry stored"
    cleanly with Gobley 0.3.7 + AGP 8.9.3 + Kotlin 2.1.20.
  - lsposed/app/build.gradle.kts: `lint { checkTestSources = false }`.
    Skips lintAnalyzeDebugUnitTest / lintAnalyzeDebugAndroidTest. Test
    sources here are pure JVM unit-test logic — functional bugs caught
    by :app:testDebugUnitTest, no Android-lifecycle code to lint.
    Deliberately leave `checkReleaseBuilds` at its default so ad-hoc
    `./gradlew :app:lint` still catches R8/ProGuard issues.
  - .github/workflows/ci.yml: `:app:lint` -> `:app:lintDebug`. Lints
    the debug variant only on PRs; release-variant Lint stays
    available locally / for future tag-time CI.
  - docs/development.md: refresh local-lint snippet.

Expected effect on warm cache (cumulative on top of PR #105):
  lint     286s -> ~190s  (3m10s, -32%)
  lsposed  227s -> ~130s  (2m10s, -42%)
This commit is contained in:
okhsunrog 2026-04-27 00:28:25 +03:00
parent 7fd63f5e22
commit 5350f8e2f6
5 changed files with 35 additions and 2 deletions

View file

@ -53,6 +53,11 @@ RUN curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | \
rustup target add aarch64-linux-android && \
rustup component add rustfmt clippy && \
cargo install cargo-ndk --locked && \
# Pre-built uniffi-bindgen so Gobley's :app:installUniffiBindgen task
# finds it ready (instead of running `cargo install uniffi-bindgen` on
# every CI build — that took ~50 s of the lsposed/lint job each run).
# Version range matches lsposed/native/Cargo.toml's `uniffi = "0.29"`.
cargo install uniffi-bindgen --version "^0.29" --locked && \
chmod -R a+w /usr/local/rustup /usr/local/cargo
# ── Android NDK (for zygisk) ─────────────────────────────────────────

View file

@ -112,7 +112,10 @@ jobs:
# of twice. ANDROID_NDK_ROOT is baked into the CI image
# (Dockerfile ENV), no manual export needed.
- name: Android lint + Kotlin unit tests
run: cd lsposed && ./gradlew :app:lint :app:testDebugUnitTest
# `:app:lintDebug` (not `:app:lint`) runs Lint on the debug
# variant only — release-variant Lint covers R8/ProGuard issues
# and is reserved for ad-hoc local runs / future tag CI.
run: cd lsposed && ./gradlew :app:lintDebug :app:testDebugUnitTest
kmod:
runs-on: ubuntu-latest