Skip to content

Stabilize Maestro CI runners#6

Closed
riderx wants to merge 10 commits intomainfrom
codex/maestro-ci-runners-green
Closed

Stabilize Maestro CI runners#6
riderx wants to merge 10 commits intomainfrom
codex/maestro-ci-runners-green

Conversation

@riderx
Copy link
Copy Markdown
Member

@riderx riderx commented Apr 8, 2026

What

  • stabilize Android Maestro CI execution and workflow wiring
  • keep iOS and Android example-app Maestro coverage running in GitHub Actions
  • add workflow dispatch support so branch-head validation can be rerun reliably

Why

  • the previous PR merged while these CI fixes were still in progress
  • Android Maestro was failing in CI for workflow/script reasons rather than product bugs
  • the branch needed a fresh PR for the remaining unmerged commits

How

  • fixed the Android workflow step so Gradle and Maestro run from the correct paths
  • removed the extra Android ADB port-forward that conflicted with Maestro's own forwarder
  • kept the branch-level workflow usable with manual dispatch for validation

Testing

  • GitHub Actions workflow Build source code and test it on commit 8c6026e
  • successful run: 24143425949
  • passed jobs: Build code and test, build_android, build_ios, guard_swiftpm_version, maestro_android, maestro_ios

Not Tested

  • no additional manual device testing outside the existing CI/example-app flows

Summary by CodeRabbit

  • Chores
    • CI: added manual workflow trigger, extended iOS build timeout, removed legacy LFS usage, pinned Rust toolchain, and added building/uploading/restoring a native iOS core artifact.
    • CI: replaced a custom Android emulator startup script with a standard emulator runner and explicit APK build/install steps.
    • Scripts: removed legacy emulator startup script and simplified Android test port-forward handling.
  • Documentation
    • Clarified Android Maestro testing flow, bootstrap/port-forward responsibilities, and local install-order expectations.

@coderabbitai
Copy link
Copy Markdown

coderabbitai bot commented Apr 8, 2026

Note

Reviews paused

It looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the reviews.auto_review.auto_pause_after_reviewed_commits setting.

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Use the checkboxes below for quick actions:

  • ▶️ Resume reviews
  • 🔍 Trigger review

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: ff4c7fe6-1150-4b32-9f6d-e3f9f596f309

📥 Commits

Reviewing files that changed from the base of the PR and between fd14447 and 0b460a1.

📒 Files selected for processing (1)
  • example-app/.maestro/image-conversion.yaml

📝 Walkthrough

Walkthrough

CI workflow updated: manual trigger added; iOS job pins Rust 1.90.0, builds/uploads native xcframework; Android CI replaces custom emulator script with android-emulator-runner and inline APK install; Android CI script removed; minor script path, Maestro port-forward, test flow, README, and rust-toolchain changes.

Changes

Cohort / File(s) Summary
CI Workflow
.github/workflows/test.yml
Added workflow_dispatch; removed actions/checkout LFS flags; increased build_ios.timeout-minutes (30→90); build_ios sets up Rust 1.90.0, runs rust native xcframework build, archives/uploads artifact; maestro_android now uses reactivecircus/android-emulator-runner@v2 and an inline script to assemble/install the APK and run bun run maestro:android; maestro_ios downloads and extracts the native iOS core artifact.
Removed CI script
example-app/scripts/run-maestro-android-ci.sh
Deleted full emulator orchestration script previously used in Android CI (AVD/system-image install, emulator lifecycle, device setup, Gradle build/install and Maestro invocation).
Local Android script
example-app/scripts/run-maestro-android.sh
Removed immediate re-establishment of ADB tcp:7001 forwarding prior to running Maestro; cleanup still removes forwarding on exit.
Docs / Test flow
example-app/README.md, example-app/.maestro/unsupported-reencode-android.yaml, example-app/.maestro/image-conversion.yaml
README: clarified Android Maestro bootstrapping and CLI artifact expectation; unsupported-reencode YAML: shortened/retargeted UI flow and assertions; image-conversion YAML: added retryTapIfNoChange, broadened output regex, increased wait timeout.
Rust configs & scripts
rust/build_x264_ios_sim_arm64.sh, rust-toolchain.toml
build_x264_ios_sim_arm64.sh updated X264_DIR to "$SCRIPT_DIR/rust/x264"; added rust-toolchain.toml pinning Rust to channel 1.90.0.

Sequence Diagram(s)

sequenceDiagram
    participant GH as GitHub Actions
    participant Runner as android-emulator-runner
    participant Emulator as Android Emulator
    participant CI_Script as inline CI script
    participant Gradle as Gradle
    participant ADB as adb
    participant Maestro as Maestro CLI / Instrumentation

    GH->>Runner: start emulator (API 34, google_atd, x86_64, Pixel 6)
    Runner->>Emulator: boot with emulator options (extended timeout, opts)
    Runner->>GH: emulator ready
    GH->>CI_Script: run inline script
    CI_Script->>Gradle: ./gradlew assembleDebug
    Gradle-->>CI_Script: debug APK
    CI_Script->>ADB: install APK on Emulator
    CI_Script->>Maestro: bun run maestro:android
    Maestro->>Emulator: run instrumentation / embedded driver APKs
    Maestro->>ADB: perform CLI-managed port-forwarding
Loading
sequenceDiagram
    participant GH as GitHub Actions
    participant Rust as Rust toolchain (1.90.0)
    participant Build as native iOS core build script
    participant Archiver as tar + upload-artifact
    participant Runner as downstream job (maestro_ios)

    GH->>Rust: setup Rust toolchain 1.90.0
    GH->>Build: cd rust && ./build_native_xcframework.sh
    Build-->>Archiver: produce ios/CapacitorFFmpegNativeCore.xcframework
    Archiver->>GH: upload tarball artifact
    Runner->>GH: download artifact
    Runner->>Archiver: extract tarball into ios/
Loading

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~45 minutes

Poem

🐰 I hopped from scripts to Actions bright,
Emulators wake in morning light.
Rust cores packed snug in tar,
APKs installed, CI climbs the star.
Rabbit cheers — pipelines take flight! 🥕✨

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title 'Stabilize Maestro CI runners' directly and clearly summarizes the main objective of the PR: stabilizing the Android and iOS Maestro CI execution in GitHub Actions workflows.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch codex/maestro-ci-runners-green

Comment @coderabbitai help to get the list of available commands and usage tips.

@riderx riderx mentioned this pull request Apr 8, 2026
Copy link
Copy Markdown

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🧹 Nitpick comments (1)
example-app/README.md (1)

44-44: Mention the local Maestro prerequisite here.

This paragraph explains the CLI/script split well, but bun run maestro:android still fails fast unless Maestro CLI is already installed locally. Adding that prerequisite next to this note would make the README easier to follow from a fresh checkout.

✍️ Suggested wording
 The Android script bootstraps Maestro's embedded driver APKs explicitly and starts the instrumentation runner before running the flows. The CLI still owns the ADB port-forward setup so local runs match CI without fighting Maestro's session setup.
+Install Maestro CLI first before running `bun run maestro:android`; the script expects the local CLI artifacts under `$HOME/.maestro`.
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@example-app/README.md` at line 44, Update the README paragraph about the
Android script to explicitly list the local prerequisite that the Maestro CLI
must be installed before running "bun run maestro:android"; edit the section
containing the sentence about bootstrapping Maestro's embedded driver APKs and
ADB port-forwarding to add a short note like “Prerequisite: Maestro CLI
installed locally (required for bun run maestro:android to succeed)”, so readers
see the requirement next to the CLI/script explanation.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Nitpick comments:
In `@example-app/README.md`:
- Line 44: Update the README paragraph about the Android script to explicitly
list the local prerequisite that the Maestro CLI must be installed before
running "bun run maestro:android"; edit the section containing the sentence
about bootstrapping Maestro's embedded driver APKs and ADB port-forwarding to
add a short note like “Prerequisite: Maestro CLI installed locally (required for
bun run maestro:android to succeed)”, so readers see the requirement next to the
CLI/script explanation.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 14a65aff-aa15-431a-9a0d-8c531d322af4

📥 Commits

Reviewing files that changed from the base of the PR and between b489117 and 8c6026e.

📒 Files selected for processing (4)
  • .github/workflows/test.yml
  • example-app/README.md
  • example-app/scripts/run-maestro-android-ci.sh
  • example-app/scripts/run-maestro-android.sh
💤 Files with no reviewable changes (2)
  • example-app/scripts/run-maestro-android.sh
  • example-app/scripts/run-maestro-android-ci.sh

Copy link
Copy Markdown

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🧹 Nitpick comments (2)
.github/workflows/test.yml (2)

118-121: Build the debug APK before booting the emulator.

example-app/scripts/run-maestro-android.sh only needs the app to already be installed. Keeping assembleDebug inside the emulator block means the emulator sits booted while Gradle compiles, which adds runtime and flake surface without changing the handoff to bun run maestro:android.

♻️ Possible split
+      - name: Build Android debug APK
+        run: ./example-app/android/gradlew -p ./example-app/android assembleDebug
       - name: Run Android Maestro flows
         uses: reactivecircus/android-emulator-runner@v2
         with:
           api-level: 34
           target: google_atd
           arch: x86_64
           profile: pixel_6
           emulator-boot-timeout: 900
           emulator-options: -no-window -gpu swiftshader_indirect -no-snapshot -noaudio -no-boot-anim -camera-back none -camera-front none
           disable-animations: true
           script: |
-            ./example-app/android/gradlew -p ./example-app/android assembleDebug
             adb install -r example-app/android/app/build/outputs/apk/debug/app-debug.apk
             cd example-app && bun run maestro:android
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In @.github/workflows/test.yml around lines 118 - 121, Move the Gradle build out
of the emulator boot step so the APK is compiled before the emulator starts: run
./example-app/android/gradlew -p ./example-app/android assembleDebug first (so
the debug APK is ready), then boot the emulator and run adb install -r
example-app/android/app/build/outputs/apk/debug/app-debug.apk followed by cd
example-app && bun run maestro:android; ensure the workflow step referencing
example-app/scripts/run-maestro-android.sh is only run after the assembleDebug
step completes.

54-55: Consider pinning the Rust toolchain to a specific version instead of stable.

The workflow currently uses dtolnay/rust-toolchain@stable, which tracks the latest stable Rust release. This can cause unexpected build failures if a new stable version introduces breaking changes affecting build_native_xcframework.sh. The repository has no pinned Rust version file (rust-toolchain or rust-toolchain.toml), so either create one to establish a consistent toolchain version across the project, or specify an explicit version directly in this workflow step.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In @.github/workflows/test.yml around lines 54 - 55, The workflow step named
"Setup Rust" currently uses dtolnay/rust-toolchain@stable which floats; pin the
toolchain by either creating a rust-toolchain or rust-toolchain.toml in the repo
with your chosen channel/version (e.g., 1.xx.x) or replace the action reference
dtolnay/rust-toolchain@stable with an explicit tag/version (e.g.,
dtolnay/rust-toolchain@1.xx.x) so builds of the "Setup Rust" step and the script
build_native_xcframework.sh use a consistent, reproducible Rust toolchain.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Nitpick comments:
In @.github/workflows/test.yml:
- Around line 118-121: Move the Gradle build out of the emulator boot step so
the APK is compiled before the emulator starts: run
./example-app/android/gradlew -p ./example-app/android assembleDebug first (so
the debug APK is ready), then boot the emulator and run adb install -r
example-app/android/app/build/outputs/apk/debug/app-debug.apk followed by cd
example-app && bun run maestro:android; ensure the workflow step referencing
example-app/scripts/run-maestro-android.sh is only run after the assembleDebug
step completes.
- Around line 54-55: The workflow step named "Setup Rust" currently uses
dtolnay/rust-toolchain@stable which floats; pin the toolchain by either creating
a rust-toolchain or rust-toolchain.toml in the repo with your chosen
channel/version (e.g., 1.xx.x) or replace the action reference
dtolnay/rust-toolchain@stable with an explicit tag/version (e.g.,
dtolnay/rust-toolchain@1.xx.x) so builds of the "Setup Rust" step and the script
build_native_xcframework.sh use a consistent, reproducible Rust toolchain.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 68ee1f99-59c1-4bbc-b96f-0678e522b74b

📥 Commits

Reviewing files that changed from the base of the PR and between b0a5cd8 and 5080c07.

📒 Files selected for processing (2)
  • .github/workflows/test.yml
  • rust/build_x264_ios_sim_arm64.sh

@riderx
Copy link
Copy Markdown
Member Author

riderx commented Apr 13, 2026

Superseded by #8, which targets main and contains the current green Maestro CI work.

@riderx riderx closed this Apr 13, 2026
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.

1 participant