|
| 1 | +# Device Cloud for EAS Workflows |
| 2 | + |
| 3 | +Run [Maestro](https://maestro.mobile.dev) flows on [devicecloud.dev](https://devicecloud.dev) from [EAS Workflows](https://docs.expo.dev/eas/workflows/get-started/). A drop-in for Expo's `maestro-cloud` job that targets Device Cloud instead. |
| 4 | + |
| 5 | +## Quick start |
| 6 | + |
| 7 | +```yaml |
| 8 | +jobs: |
| 9 | + build_android: |
| 10 | + type: build |
| 11 | + params: |
| 12 | + platform: android |
| 13 | + profile: preview |
| 14 | + |
| 15 | + e2e: |
| 16 | + after: [build_android] |
| 17 | + runs_on: linux-medium |
| 18 | + outputs: |
| 19 | + console_url: ${{ steps.dcd.outputs.console_url }} |
| 20 | + status: ${{ steps.dcd.outputs.upload_status }} |
| 21 | + steps: |
| 22 | + - uses: eas/checkout |
| 23 | + - id: dcd |
| 24 | + run: npx --yes @devicecloud.dev/eas-workflow@v0 --flows ./.maestro --android-device pixel-7 |
| 25 | + env: |
| 26 | + DEVICE_CLOUD_API_KEY: ${{ secrets.DEVICE_CLOUD_API_KEY }} |
| 27 | + EAS_BUILD_URL: ${{ after.build_android.outputs.build_url }} |
| 28 | + EAS_GH_SHA: ${{ github.sha }} |
| 29 | +``` |
| 30 | +
|
| 31 | +Full Android and iOS examples are in [`examples/`](./examples/). |
| 32 | + |
| 33 | +## Inputs |
| 34 | + |
| 35 | +The wrapper takes its config from two places: **environment variables** (for context that's the same across runs) and **CLI flags** (for per-flow options). Anything you pass on the command line is forwarded as-is to `dcd cloud`. |
| 36 | + |
| 37 | +### Environment variables |
| 38 | + |
| 39 | +| Var | Required | Source in YAML | Purpose | |
| 40 | +|---|---|---|---| |
| 41 | +| `DEVICE_CLOUD_API_KEY` | ✅ | `${{ secrets.DEVICE_CLOUD_API_KEY }}` | Device Cloud API key | |
| 42 | +| `EAS_BUILD_URL` | when no `--app-binary-id`/`--app-file` | `${{ after.<job>.outputs.build_url }}` | Signed URL to the EAS build artifact | |
| 43 | +| `EAS_BUILD_ID` | optional | `${{ after.<job>.outputs.build_id }}` | Tagged as `eas_build_id` metadata | |
| 44 | +| `EAS_BUILD_PLATFORM` | optional | `${{ after.<job>.outputs.platform }}` | Tagged as `eas_platform` metadata | |
| 45 | +| `EAS_BUILD_PROFILE` | optional | (you set this) | Tagged as `eas_profile` metadata | |
| 46 | +| `EAS_APP_VERSION` | optional | `${{ after.<job>.outputs.app_version }}` | Tagged as `eas_app_version` metadata | |
| 47 | +| `EAS_GH_SHA` | optional | `${{ github.sha }}` | Tagged as `gh_sha` metadata | |
| 48 | +| `EAS_GH_BRANCH` | optional | `${{ github.ref_name }}` | Tagged as `gh_branch` metadata | |
| 49 | +| `EAS_GH_PR_NUMBER` | optional | `${{ github.event.pull_request.number }}` | Tagged as `gh_pr_number` metadata | |
| 50 | +| `EAS_GH_PR_URL` | optional | `${{ github.event.pull_request.html_url }}` | Tagged as `gh_pr_url` metadata | |
| 51 | +| `EAS_GH_REPO` | optional | `${{ github.repository }}` | Tagged as `gh_repo` metadata | |
| 52 | +| `EAS_GH_RUN_ID` | optional | `${{ github.run_id }}` | Tagged as `gh_run_id` metadata | |
| 53 | +| `DEVICE_CLOUD_API_URL` | optional | — | Override API URL (staging only) | |
| 54 | +| `DCD_USE_BETA` | optional | — | Set to `true` to use the beta CLI | |
| 55 | + |
| 56 | +### CLI flags |
| 57 | + |
| 58 | +Everything you pass after `npx @devicecloud.dev/eas-workflow@v0 ...` is forwarded verbatim to `dcd cloud`. Common ones: |
| 59 | + |
| 60 | +- `--flows <path>` — directory of Maestro flows (e.g. `./.maestro`) |
| 61 | +- `--android-device <model>` — `pixel-6`, `pixel-7`, `pixel-7-pro`, … |
| 62 | +- `--android-api-level <n>` — `29`–`36` |
| 63 | +- `--ios-device <model>` — `iphone-16`, `iphone-16-pro`, … |
| 64 | +- `--ios-version <n>` — `16`, `17`, `18`, `26` |
| 65 | +- `--maestro-version <semver>` |
| 66 | +- `--include-tags`, `--exclude-tags` |
| 67 | +- `--retry <n>` |
| 68 | +- `--async` |
| 69 | +- `--google-play` |
| 70 | + |
| 71 | +See [docs.devicecloud.dev/cli](https://docs.devicecloud.dev/cli) for the full list. |
| 72 | + |
| 73 | +## Outputs |
| 74 | + |
| 75 | +Emitted as `set-output <name> <value>` lines on stdout and surfaced as EAS step outputs: |
| 76 | + |
| 77 | +| Output | Type | Description | |
| 78 | +|---|---|---| |
| 79 | +| `console_url` | string | Direct link to the test run in the Device Cloud console | |
| 80 | +| `upload_status` | `PASSED` \| `FAILED` \| `CANCELLED` \| `PENDING` \| `RUNNING` | Final status of the run | |
| 81 | +| `app_binary_id` | string | ID of the uploaded app binary (reuse with `--app-binary-id` for faster reruns) | |
| 82 | +| `flow_results` | JSON string | Array of `{name, status}` per flow | |
| 83 | + |
| 84 | +Reference downstream like `${{ steps.dcd.outputs.console_url }}` (same job) or `${{ needs.e2e.outputs.console_url }}` (different job, with `needs:` / `after:`). |
| 85 | + |
| 86 | +## Exit codes |
| 87 | + |
| 88 | +- `0` — all flows passed, or the wrapper ran in async mode |
| 89 | +- `1` — at least one flow failed, the run was cancelled, or the wrapper hit an internal error |
| 90 | + |
| 91 | +## Choosing a runner |
| 92 | + |
| 93 | +`linux-medium` is fine for the wrapper itself — it just shells out to the Device Cloud platform, which runs your devices remotely. macOS runners are not required for iOS flows (the iOS simulators live on Device Cloud's Mac fleet). |
| 94 | + |
| 95 | +## Migrating from `maestro-cloud` |
| 96 | + |
| 97 | +EAS's built-in `maestro-cloud` job is hardcoded to Maestro Cloud. Swap the whole job for a `runs_on` custom job: |
| 98 | + |
| 99 | +```yaml |
| 100 | +# Before |
| 101 | +e2e: |
| 102 | + type: maestro-cloud |
| 103 | + params: |
| 104 | + build_id: ${{ after.build.outputs.build_id }} |
| 105 | + maestro_project_id: proj_xxx |
| 106 | + flows: ./.maestro |
| 107 | + maestro_api_key: ${{ secrets.MAESTRO_CLOUD_API_KEY }} |
| 108 | +
|
| 109 | +# After |
| 110 | +e2e: |
| 111 | + after: [build] |
| 112 | + runs_on: linux-medium |
| 113 | + steps: |
| 114 | + - id: dcd |
| 115 | + run: npx --yes @devicecloud.dev/eas-workflow@v0 --flows ./.maestro |
| 116 | + env: |
| 117 | + DEVICE_CLOUD_API_KEY: ${{ secrets.DEVICE_CLOUD_API_KEY }} |
| 118 | + EAS_BUILD_URL: ${{ after.build.outputs.build_url }} |
| 119 | +``` |
| 120 | + |
| 121 | +## Releases |
| 122 | + |
| 123 | +The wrapper auto-bundles `dist/index.js` on push to `main`. Pin to a major (`@v0`) for stability or a specific version (`@0.1.0`) for reproducibility. |
0 commit comments