Skip to content

Add recent Android API levels (28, 29, 31, 33, 34) to instrumentation CI matrix#2803

Merged
pyricau merged 6 commits intomainfrom
worktree-add-emulators
Feb 26, 2026
Merged

Add recent Android API levels (28, 29, 31, 33, 34) to instrumentation CI matrix#2803
pyricau merged 6 commits intomainfrom
worktree-add-emulators

Conversation

@pyricau
Copy link
Copy Markdown
Member

@pyricau pyricau commented Feb 26, 2026

Summary

  • Adds API levels 28, 29, 31, 33, and 34 (Android 9 through 14) to the instrumentation test CI matrix
  • All new entries use x86_64 + google_apis + stable channel, consistent with existing modern emulator entries (21, 23, 26)
  • API 29 was previously commented out as "flaky" — retrying with current tooling
  • Removed the stale commented-out API 30 block (it had wrong target/channel; can be reconsidered separately if needed)

Test plan

  • CI passes for all new API levels
  • Capture job duration per emulator to inform future decisions about which API levels to keep

🤖 Generated with Claude Code

Comment thread .github/workflows/main.yml Fixed
pyricau and others added 5 commits February 26, 2026 20:06
Add API levels 28, 29, 31, 33, and 34 (Android 9-14) to the CI
emulator matrix. API 29 was previously marked flaky but is worth
retrying with current tooling. All use x86_64 + google_apis + stable
channel, consistent with the existing modern emulator configuration.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…n@v4

The old gradle/wrapper-validation-action@v1 was silently failing on all
PR runs (works on push-to-main but not on PR merge commits). The modern
replacement is gradle/actions/wrapper-validation which is actively
maintained by Gradle.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…ndroid tests

Android 9 (API 28) and above refuse to install APKs that target
SDK version < 23. The leakcanary-android module was missing an explicit
targetSdk in its defaultConfig, causing the test APK to default to
targetSdkVersion = minSdkVersion = 14.

leakcanary-android-core already had this fix with an explanatory comment.
Apply the same to leakcanary-android so it can run on API 28-34 emulators.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
When targetSdk >= 33 and notifications are not enabled (fresh emulator),
Notifications.canShowNotification launches RequestPermissionActivity with
FLAG_ACTIVITY_NEW_TASK to request POST_NOTIFICATIONS permission. This
pushes LeakActivity to PAUSED, causing Espresso's onView() to throw
NoActivityResumedException.

The test is validating the heap import flow, not notifications. Setting
showNotifications = false prevents the permission activity from launching
so LeakActivity stays in the RESUMED state for the Espresso assertions.
The tryAndRestoreConfig wrapper already restores the original config.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Based on timing analysis across two full CI runs:
- API 28 averaged 652s (~11 min), slowest after API 29
- API 29 averaged 672s (~11 min), consistently the slowest new addition

API 31, 33, and 34 provide good modern Android coverage at reasonable
cost (568–622s avg). APIs 28 and 29 can be reconsidered later if
Android 9/10 coverage becomes a specific need.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@pyricau pyricau force-pushed the worktree-add-emulators branch from 005a522 to b72effd Compare February 26, 2026 19:07
…canning

Fixes "Insecure GitHub Actions: Third-Party Action Not Pinned to Commit SHA"
flagged by GitHub Advanced Security on PR #2803. Pins to the commit SHA
corresponding to v4 while keeping the tag as a comment for readability.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@pyricau pyricau merged commit fabd71f into main Feb 26, 2026
16 of 17 checks passed
@pyricau pyricau deleted the worktree-add-emulators branch February 26, 2026 20:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants