docs(ci): rewrite the Codemagic page around a tested sample

Merged
TO
1d ago
+286-57

What

Rewrites docs/ci/codemagic.mdx. The Android emulator step now boots a device that e2e can use, the iOS and Android workflows come from a tested sample, and the page gains sections on the replay cache, a release workflow gated on e2e, and coding-agent skills.

Why

On Codemagic's Linux machines an adb server is already running when the build starts, and it doesn't know the emulator. The old step waited for the device with adb wait-for-device, and in our runs the device showed as unauthorized and the build stalled. The old page also had no example that had been run end to end.

The Codemagic team built codemagic-e2e-flutter-sample (MIT) to cover that, and this page is based on it.

How it works

  1. The Android step creates an adb key, restarts the adb server, and starts the emulator in the background while the app builds (docs/ci/codemagic.mdx:128).
  2. The install step waits up to five minutes for sys.boot_completed, prints adb devices and the emulator log if it never comes, then pauses 10 seconds so the first test doesn't hit a screen that is still settling (docs/ci/codemagic.mdx:144).
  3. The iOS workflow picks the newest Pro simulator, boots it while the app builds, and passes its UDID on through E2E_IOS_DEVICE (docs/ci/codemagic.mdx:86).
  4. The first yaml block is the sample's definitions and its two e2e workflows, copied verbatim. The release block is the sample's release-ios with its signing and publishing blocks on. Both use the same step anchors, so the tests that gate a release are the ones that run on every push. Comments mark the test selection as sample only, and one sentence says to restrict who can push v* tags (docs/ci/codemagic.mdx:273).
  5. "What you can do" lists what the integration gives you. "Model key" explains replaying a committed cache, keeps the warning about secrets in pull request builds, and points to --strict-cache for stale recordings (docs/ci/codemagic.mdx:28, :236).
  6. The setup prompt points the agent at the sample's codemagic.yaml, and "Use a coding agent" links the two skills in the sample repo (docs/ci/codemagic.mdx:10, :334).

The yaml is a Flutter example, as the sample is. The page says which lines to replace for another framework.

Verified

Ran it locally: yes

  • Both workflows run in Codemagic from the sample repo: iOS and Android each pass 7 of 7 tests, including the agent test replayed from the committed cache.
  • Without the adb key and server restart the Android device stays unauthorized and the run fails. With them it boots and passes.
  • Both yaml blocks validate against the Codemagic schema, and the first is identical to the sample's codemagic.yaml (commit e1d32a3).
  • Ran the checks that pnpm docs:check runs, directly with node: package managers, anchors, logos and MDX all pass. The translations check only warns on pages this PR doesn't touch.
  • Not checked: the page in the docs site preview, since I can't build the site. A maintainer can run /docs-preview for the preview.
  • Not run: the signed release workflow against a real App Store Connect or Google Play app.

Checklist

  • Changeset not needed: docs only.
  • Not a breaking change.
  • Docs updated in the same PR: this is the docs page. skills/e2e/ doesn't describe Codemagic.
  • No contract change.
  • No engine contract change.

Summary by CodeRabbit

  • Documentation
    • Updated the Codemagic guide with a Flutter example covering iOS simulator and Android emulator workflows, shared build and test steps, test artifacts, and push and pull-request triggers.
    • Added setup guidance for builds, emulators, cached test recordings, and securely handling API keys. The guide explains when agent tests run and how to gate releases on test results.
    • Included guidance for coding-agent workflows and a TestFlight release example.