ci(android): fix CI runner (JDK/SDK/gradlew) + variant test
Some checks failed
PR Checks / android-build (pull_request) Failing after 2m48s
Some checks failed
PR Checks / android-build (pull_request) Failing after 2m48s
PR #2 merged the M0 scaffold with the initial CI, which fails on this self-hosted runner. Fix forward: - JDK 17 via apt (openjdk-17-jdk-headless) + JAVA_HOME, replacing actions/setup-java: the runner can't resolve api.adoptium.net (EAI_AGAIN). - Explicit `sdkmanager` install of platform-tools + platforms;android-35 + build-tools;35.0.0 so the build never relies on AGP auto-download. - `chmod +x ./gradlew` in the run step (and set the 100755 git bit): this runner's checkout drops file modes, so `./gradlew` alone hit "Permission denied" (exit 126). - ScaffoldSanityTest: drop the BuildConfig.DEBUG assertion, which fails under testReleaseUnitTest (the `test` task runs both variants); assert VERSION_NAME. - Remove the redundant android:label on MainActivity (RedundantLabel lint). Verified locally against the Android Studio SDK (platform 35 + build-tools 35.0.0): `./gradlew lint test assembleDebug` passes and builds a debug APK. Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
@@ -10,6 +10,9 @@ import org.junit.Test
|
||||
/**
|
||||
* Placeholder JVM unit test so the `test` CI gate has something to run in M0.
|
||||
* Real repository / view-model tests arrive with the functional pass (M1+).
|
||||
*
|
||||
* Assertions must be variant-agnostic: the `test` task runs both the debug and
|
||||
* release unit-test variants, so nothing here may depend on `BuildConfig.DEBUG`.
|
||||
*/
|
||||
class ScaffoldSanityTest {
|
||||
@Test
|
||||
@@ -18,8 +21,7 @@ class ScaffoldSanityTest {
|
||||
}
|
||||
|
||||
@Test
|
||||
fun buildConfigIsDebuggableInTest() {
|
||||
// Unit tests run against the debug variant.
|
||||
assertTrue(BuildConfig.DEBUG)
|
||||
fun versionNameIsSet() {
|
||||
assertTrue(BuildConfig.VERSION_NAME.isNotBlank())
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user