mirror of
https://github.com/okhsunrog/vpnhide.git
synced 2026-04-28 06:31:27 +00:00
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:
parent
7fd63f5e22
commit
5350f8e2f6
5 changed files with 35 additions and 2 deletions
5
.github/docker/ci/Dockerfile
vendored
5
.github/docker/ci/Dockerfile
vendored
|
|
@ -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) ─────────────────────────────────────────
|
||||
|
|
|
|||
5
.github/workflows/ci.yml
vendored
5
.github/workflows/ci.yml
vendored
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -120,7 +120,7 @@ gcc -O2 -Wall -Werror -o /tmp/test_iface_lists kmod/test_iface_lists.c && /tmp/t
|
|||
|
||||
# Kotlin
|
||||
ktlint "lsposed/**/*.kt"
|
||||
cd lsposed && ./gradlew :app:lint :app:testDebugUnitTest
|
||||
cd lsposed && ./gradlew :app:lintDebug :app:testDebugUnitTest
|
||||
```
|
||||
|
||||
## Build versions
|
||||
|
|
|
|||
|
|
@ -110,6 +110,20 @@ android {
|
|||
packaging {
|
||||
resources.excludes += "META-INF/*.kotlin_module"
|
||||
}
|
||||
|
||||
// Skip Android Lint on test source sets. Our `src/test/` is pure JVM
|
||||
// unit-test logic (filter/recommendation builders) — no Android
|
||||
// lifecycle, no layouts, no context misuse. Functional bugs are
|
||||
// caught by `:app:testDebugUnitTest`. Saves ~15–20 s of
|
||||
// `lintAnalyze*Test` per Lint run.
|
||||
//
|
||||
// We deliberately leave `checkReleaseBuilds` at its default (true):
|
||||
// CI invokes `:app:lintDebug` on PRs (so the release variant isn't
|
||||
// analysed there), but ad-hoc `./gradlew :app:lint` on a release
|
||||
// build still catches R8/ProGuard-specific issues like MissingRules.
|
||||
lint {
|
||||
checkTestSources = false
|
||||
}
|
||||
}
|
||||
|
||||
dependencies {
|
||||
|
|
|
|||
|
|
@ -2,3 +2,14 @@ org.gradle.jvmargs=-Xmx2048m -Dfile.encoding=UTF-8
|
|||
android.useAndroidX=true
|
||||
kotlin.code.style=official
|
||||
android.nonTransitiveRClass=true
|
||||
|
||||
# Reuse task outputs across builds when inputs match. Combined with
|
||||
# gradle/actions/setup-gradle in CI, repeat builds of the same code go
|
||||
# UP-TO-DATE on most tasks instead of executing again.
|
||||
org.gradle.caching=true
|
||||
|
||||
# Skip the configuration phase entirely when nothing in the build files
|
||||
# has changed. Verified compatible with Gobley 0.3.7 + AGP 8.9.3 +
|
||||
# Kotlin 2.1.20 (`./gradlew :app:assembleDebug --configuration-cache`
|
||||
# reports "Configuration cache entry stored" without warnings).
|
||||
org.gradle.configuration-cache=true
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue