Skip to content

Commit 4eee1cd

Browse files
cortinicometa-codesync[bot]
authored andcommitted
Add Maestro Cloud CI for RNTester (#58151)
Summary: Pull Request resolved: #58151 Run the release RNTester Maestro flows in Maestro Cloud for iOS and Android on pushes to main and same-repository pull requests. Reuse the existing build artifacts and read both the API key and project ID from repository secrets. The existing local Maestro jobs remain unchanged because debug flows require a running bundler that is unavailable in Maestro Cloud. Changelog: [Internal] Reviewed By: cipolleschi Differential Revision: D117513755 fbshipit-source-id: 78ad2b627783c2a750796a1c95648b00c913f350
1 parent 7eafaa2 commit 4eee1cd

2 files changed

Lines changed: 123 additions & 0 deletions

File tree

Lines changed: 77 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,77 @@
1+
name: Maestro Cloud RNTester
2+
3+
permissions:
4+
contents: read
5+
6+
on:
7+
workflow_call:
8+
inputs:
9+
platform:
10+
description: 'Platform name shown in the Maestro Cloud run'
11+
required: true
12+
type: string
13+
artifact-name:
14+
description: 'Name of the RNTester build artifact'
15+
required: true
16+
type: string
17+
download-path:
18+
description: 'Directory where the build artifact is downloaded'
19+
required: true
20+
type: string
21+
app-file:
22+
description: 'Path to the app bundle or APK passed to Maestro Cloud'
23+
required: true
24+
type: string
25+
app-id:
26+
description: 'RNTester application identifier'
27+
required: true
28+
type: string
29+
exclude-tags:
30+
description: 'Maestro flow tags to exclude'
31+
required: true
32+
type: string
33+
secrets:
34+
MAESTRO_CLOUD_API_KEY:
35+
required: true
36+
MAESTRO_CLOUD_PROJECT_ID:
37+
required: true
38+
39+
jobs:
40+
test:
41+
name: Maestro Cloud ${{ inputs.platform }} RNTester
42+
runs-on: ubuntu-latest
43+
timeout-minutes: 75
44+
steps:
45+
- name: Checkout
46+
uses: actions/checkout@v6
47+
with:
48+
persist-credentials: false
49+
- name: Download RNTester app
50+
uses: actions/download-artifact@v7
51+
with:
52+
name: ${{ inputs.artifact-name }}
53+
path: ${{ inputs.download-path }}
54+
- name: Validate Maestro Cloud inputs
55+
env:
56+
MAESTRO_APP_FILE: ${{ inputs.app-file }}
57+
MAESTRO_CLOUD_API_KEY: ${{ secrets.MAESTRO_CLOUD_API_KEY }}
58+
MAESTRO_CLOUD_PROJECT_ID: ${{ secrets.MAESTRO_CLOUD_PROJECT_ID }}
59+
run: |
60+
test -e "$MAESTRO_APP_FILE"
61+
test -n "$MAESTRO_CLOUD_API_KEY"
62+
test -n "$MAESTRO_CLOUD_PROJECT_ID"
63+
test -z "$(find packages/rn-tester/.maestro -type l -print -quit)"
64+
- name: Run flows on Maestro Cloud
65+
uses: mobile-dev-inc/action-maestro-cloud@5759506b4ec7ee0a1ece4b7e6574bba2b282f241 # v3.0.1
66+
with:
67+
api-key: ${{ secrets.MAESTRO_CLOUD_API_KEY }}
68+
project-id: ${{ secrets.MAESTRO_CLOUD_PROJECT_ID }}
69+
app-file: ${{ inputs.app-file }}
70+
workspace: packages/rn-tester/.maestro
71+
branch: ${{ github.head_ref || github.ref_name }}
72+
name: RNTester ${{ inputs.platform }} - ${{ github.event.pull_request.title || github.sha }}
73+
exclude-tags: ${{ inputs.exclude-tags }}
74+
env: |
75+
APP_ID=${{ inputs.app-id }}
76+
maestro-cli-version: 2.6.1
77+
timeout: 60

.github/workflows/test-all.yml

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -163,6 +163,30 @@ jobs:
163163
use-prebuilds: true
164164
flavor: ${{ matrix.flavor }}
165165

166+
test_maestro_cloud_ios:
167+
needs: test_ios_rntester
168+
# test_ios_rntester is continue-on-error. If its Release artifact is missing,
169+
# the reusable workflow fails explicitly while downloading or validating it.
170+
if: |
171+
needs.test_ios_rntester.result == 'success' &&
172+
(
173+
(github.event_name == 'push' && github.ref == 'refs/heads/main') ||
174+
(
175+
github.event_name == 'pull_request' &&
176+
github.event.pull_request.head.repo.full_name == github.repository &&
177+
github.actor != 'dependabot[bot]'
178+
)
179+
)
180+
uses: ./.github/workflows/maestro-cloud-rntester.yml
181+
with:
182+
platform: iOS
183+
artifact-name: RNTesterApp-NewArch-Release
184+
download-path: /tmp/RNTesterBuild/RNTester.app
185+
app-file: /tmp/RNTesterBuild/RNTester.app
186+
app-id: com.meta.RNTester.localDevelopment
187+
exclude-tags: android-only
188+
secrets: inherit
189+
166190
test_e2e_ios_rntester:
167191
needs: test_ios_rntester
168192
if: ${{ needs.test_ios_rntester.result == 'success' }}
@@ -329,6 +353,28 @@ jobs:
329353
release-type: ${{ needs.set_release_type.outputs.RELEASE_TYPE }}
330354
gradle-cache-encryption-key: ${{ secrets.GRADLE_CACHE_ENCRYPTION_KEY }}
331355

356+
test_maestro_cloud_android:
357+
needs: build_android
358+
if: |
359+
needs.build_android.result == 'success' &&
360+
(
361+
(github.event_name == 'push' && github.ref == 'refs/heads/main') ||
362+
(
363+
github.event_name == 'pull_request' &&
364+
github.event.pull_request.head.repo.full_name == github.repository &&
365+
github.actor != 'dependabot[bot]'
366+
)
367+
)
368+
uses: ./.github/workflows/maestro-cloud-rntester.yml
369+
with:
370+
platform: Android
371+
artifact-name: rntester-release
372+
download-path: /tmp/rntester-android
373+
app-file: /tmp/rntester-android/app-arm64-v8a-release.apk
374+
app-id: com.facebook.react.uiapp
375+
exclude-tags: ios-only
376+
secrets: inherit
377+
332378
test_e2e_android_rntester:
333379
needs: build_android
334380
if: ${{ needs.build_android.result == 'success' }}

0 commit comments

Comments
 (0)