Issue 3289 semaphore ci f1 - #3292
Merged
Merged
Conversation
# Conflicts: # .semaphore/semaphore.yml # script/ci-get-and-publish-debug-info-as-artifact.sh
DenBond7
marked this pull request as ready for review
September 25, 2026 17:45
sosnovsky
enabled auto-merge (squash)
September 28, 2026 11:28
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This PR migrates the Semaphore CI pipeline from legacy
e1-standard-2machine types to modernf1-standard-2instances (#3289) and implements a series of CI optimizations (parallel blocks, slim SDK caching, test matrix expansion, build artifact sharing & cleanup, and Gradle wrapper upgrade).Together, these changes reduce overall wall-clock CI runtime by 26.5% (from ~34m 19s to ~25m 14s) and cut total CI execution costs by 33.8% (from ~$1.74 to ~$1.15 per run).
Why Migrate to
f1-standard-2?Hardware Modernization & Provider Lifecycle:
e1-standard-2is an older generation instance type on Semaphore that is being phased out / deprecated in favor of newer machine families.f1-standard-2is powered by modern AMD EPYC processors offering significantly higher single-core IPC, faster memory bandwidth, and higher NVMe/SSD I/O throughput.KVM & Nested Virtualization for Android Emulators:
e1instances, cold emulator boot times were inconsistent, often taking 90–150 seconds and causing sporadic startup hangs or timeout failures.f1-standard-2, emulator initialization and snapshot restores are significantly faster (~30–45s) and more predictable, dramatically reducing flaky test failures caused by emulator sluggishness.Cost vs. Performance Balance:
f1-standard-2carries a higher nominal per-minute rate ($0.015/min vs $0.0075/min fore1), running on faster hardware combined with the pipeline optimizations below reduced overall cumulative machine time from 172m 31s to 153m 41s, and wall-clock execution time from 34m 19s to 25m 14s.f1-standard-2both faster and cheaper overall.Benchmark Results
e1/ unoptimized)f1-standard-2)Key Changes & Optimizations
1. CI Pipeline & Concurrency
.semaphore/semaphore.ymltof1-standard-2onubuntu2404.Code Quality & Unit Tests(Lint, JUnit) to run concurrently alongsideBuild Project, eliminating unnecessary sequential wait time on the critical path.No email servertest matrix from 4 to 6 parallel shards (EMULATOR=0..5). This distributes the test load evenly and drops the slowest shard runtime from ~23m to ~15m.2. Caching & Startup Overhead
android-sdk-slim):Build Project,Lint,JUnit) now restore a lightweight SDK (~250 MB / 70–90 MB compressed) containing onlyplatforms;android-36,build-tools, andplatform-tools.android-sdk-full).script/ci-setup-DNS.sh: Checks for existingdnsmasqconfiguration before attempting redundant installs and restarts.INSTALL_EMULATOR=0.3. Artifact Sharing & Automatic Cleanup
script/ci-push-build-artifacts.shandscript/ci-pull-build-artifacts.shto package and pass compiled APKs and Gradle build cache betweenBuild Projectand downstream test jobs.after_pipeline(Publish Results), addedartifact yank workflow build-cache.tarandapks.tar. This automatically frees storage immediately after pipeline completion, preventing ongoing artifact storage charges.4. Stability & Build Tooling
script/ci-get-and-publish-debug-info-as-artifact.sh, added pre-flight ADB check (adb get-state | grep -q device) and bounded commands withADB_COMMAND_TIMEOUT(15s) to prevent jobs from hanging during teardown if an emulator is absent or unresponsive.org.gradle.jvmargsingradle.propertiesto-Xmx4096m -XX:MaxMetaspaceSize=1024mfor smoother Kotlin compilation, KSP, and dexing.AndroidGradlePluginVersioncheck.close #3289
Tests (delete all except exactly one):
To be filled by reviewers
I have reviewed that this PR... (tick whichever items you personally focused on during this review):