Skip to content

Commit 6bc75ee

Browse files
XxdpavelxXjluque0101claude
authored
ci(INFRA-3596): phase4: add workflow_dispatch to build-ios-e2e, update run-e2e-api-specs runs-on (#29812)
Task: https://consensyssoftware.atlassian.net/browse/INFRA-3596 <!-- Please submit this PR as a draft initially. Do not mark it as "Ready for review" until this PR meets the canonical Definition of Ready For Review in `docs/readme/ready-for-review.md`. In short: the template must be materially complete (not just section titles present), all status checks must be currently passing, and the only expected follow-up commits must be reviewer-driven. --> ## **Description** <!-- Write a short description of the changes included in this pull request, also include relevant motivation and context. Have in mind the following questions: 1. What is the reason for the change? 2. What is the improvement/solution? --> ## **Changelog** <!-- If this PR is not End-User-Facing and should not show up in the CHANGELOG, you can choose to either: 1. Write `CHANGELOG entry: null` 2. Label with `no-changelog` If this PR is End-User-Facing, please write a short User-Facing description in the past tense like: `CHANGELOG entry: Added a new tab for users to see their NFTs` `CHANGELOG entry: Fixed a bug that was causing some NFTs to flicker` (This helps the Release Engineer do their job more quickly and accurately) --> CHANGELOG entry: null ## **Related issues** Fixes: ## **Manual testing steps** ```gherkin Feature: my feature name Scenario: user [verb for user action] Given [describe expected initial app state] When user [verb for user action] Then [describe expected outcome] ``` ## **Screenshots/Recordings** <!-- If applicable, add screenshots and/or recordings to visualize the before and after of your change. --> ### **Before** <!-- [screenshots/recordings] --> ### **After** <!-- [screenshots/recordings] --> ## **Pre-merge author checklist** <!-- Every checklist item must be consciously assessed before marking this PR as "Ready for review". A checked box means you deliberately considered that responsibility, not that you literally performed every action listed. Unchecked boxes are ambiguous: they are not an implicit "N/A" and they are not a silent "skip". See `docs/readme/ready-for-review.md` for the full checklist semantics. --> - [ ] I've followed [MetaMask Contributor Docs](https://github.com/MetaMask/contributor-docs) and [MetaMask Mobile Coding Standards](https://github.com/MetaMask/metamask-mobile/blob/main/.github/guidelines/CODING_GUIDELINES.md). - [ ] I've completed the PR template to the best of my ability - [ ] I've included tests if applicable - [ ] I've documented my code using [JSDoc](https://jsdoc.app/) format if applicable - [ ] I've applied the right labels on the PR (see [labeling guidelines](https://github.com/MetaMask/metamask-mobile/blob/main/.github/guidelines/LABELING_GUIDELINES.md)). Not required for external contributors. #### Performance checks (if applicable) - [ ] I've tested on Android - Ideally on a mid-range device; emulator is acceptable - [ ] I've tested with a power user scenario - Use these [power-user SRPs](https://consensyssoftware.atlassian.net/wiki/spaces/TL1/pages/edit-v2/401401446401?draftShareId=9d77e1e1-4bdc-4be1-9ebb-ccd916988d93) to import wallets with many accounts and tokens - [ ] I've instrumented key operations with Sentry traces for production performance metrics - See [`trace()`](/app/util/trace.ts) for usage and [`addToken`](/app/components/Views/AddAsset/components/AddCustomToken/AddCustomToken.tsx#L274) for an example For performance guidelines and tooling, see the [Performance Guide](https://consensyssoftware.atlassian.net/wiki/spaces/TL1/pages/400085549067/Performance+Guide+for+Engineers). ## **Pre-merge reviewer checklist** <!-- Reviewer checklist items follow the same semantics as the author checklist: an unchecked box is ambiguous, a checked box means the reviewer consciously assessed that responsibility. See `docs/readme/ready-for-review.md`. --> - [ ] I've manually tested the PR (e.g. pull and build branch, run the app, test code being changed). - [ ] I confirm that this PR addresses all acceptance criteria described in the ticket it closes and includes the necessary testing evidence such as recordings and or screenshots. <!-- CURSOR_SUMMARY --> --- > [!NOTE] > **Medium Risk** > Changes CI runner selection and caching behavior across multiple iOS workflows; misconfiguration could break builds/uploads or reduce cache effectiveness, but no product/runtime code is affected. > > **Overview** > Adds a `runner_provider` input (with `workflow_dispatch` choice) across iOS workflows to optionally run jobs on Namespace runners instead of GitHub/Cirrus defaults. > > Routes `runner_provider` through `build-and-upload-to-testflight` into `build.yml`/`upload-to-testflight`, updates several jobs’ `runs-on` expressions (including fixture update and BrowserStack upload flows), and adjusts iOS E2E caching so Namespace runs use `namespacelabs/nscloud-cache-action` while skipping Cirrus Xcode derived-data cache steps. > > <sup>Reviewed by [Cursor Bugbot](https://cursor.com/bugbot) for commit 856c6c5. Bugbot is set up for automated code reviews on this repo. Configure [here](https://www.cursor.com/dashboard/bugbot).</sup> <!-- /CURSOR_SUMMARY --> --------- Co-authored-by: Jose Luque <jose.luque@consensys.net> Co-authored-by: José Manuel <6741785+jluque0101@users.noreply.github.com> Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
1 parent 7c6653b commit 6bc75ee

6 files changed

Lines changed: 81 additions & 17 deletions

.github/workflows/build-and-upload-to-testflight.yml

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,11 @@ on:
2424
required: false
2525
type: boolean
2626
default: false
27+
runner_provider:
28+
description: Runner provider forwarded from the caller
29+
required: false
30+
type: string
31+
default: current
2732
workflow_dispatch:
2833
inputs:
2934
source_branch:
@@ -54,6 +59,14 @@ on:
5459
required: false
5560
type: boolean
5661
default: false
62+
runner_provider:
63+
description: Runner provider for this manual trial run
64+
required: false
65+
type: choice
66+
options:
67+
- current
68+
- namespace
69+
default: current
5770

5871
permissions:
5972
contents: write
@@ -75,6 +88,7 @@ jobs:
7588
platform: ios
7689
skip_version_bump: false
7790
source_branch: ${{ needs.prepare-build-branch.outputs.build_branch }}
91+
runner_provider: ${{ inputs.runner_provider }}
7892
secrets: inherit
7993

8094
upload-ios-testflight:
@@ -90,13 +104,14 @@ jobs:
90104
build_version: ${{ needs.build.outputs.semantic_version }}
91105
build_number: ${{ needs.build.outputs.ios_version_code }}
92106
distribute_external: ${{ inputs.distribute_external }}
107+
runner_provider: ${{ inputs.runner_provider }}
93108
secrets: inherit
94109

95110
cleanup-build-branch:
96111
name: Cleanup build branch
97112
needs: [prepare-build-branch, upload-ios-testflight]
98113
if: always()
99-
runs-on: ubuntu-latest
114+
runs-on: ${{ inputs.runner_provider == 'namespace' && 'namespace-profile-metamask-ci-linux' || 'ubuntu-latest' }}
100115
steps:
101116
- uses: actions/checkout@v4
102117
with:

.github/workflows/build-ios-e2e.yml

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -145,7 +145,7 @@ jobs:
145145

146146
- name: Restore Xcode derived data from branch cache
147147
id: xcode-restore-cache
148-
if: ${{ steps.gate.outputs.needs-native-build == 'true' }}
148+
if: ${{ steps.gate.outputs.needs-native-build == 'true' && inputs.runner_provider != 'namespace' }}
149149
# This action automatically updates the cache at the end of the workflow
150150
uses: cirruslabs/cache@bba69c6578b863ad0398ad40567bd2ef70290fe0 # v4
151151
with:
@@ -155,7 +155,7 @@ jobs:
155155
key: ${{ runner.os }}-xcode-${{ github.ref_name }}-${{ env.XCODE_CACHE_VERSION }}-${{ hashFiles('ios/**/*.{h,m,mm,swift}', 'ios/**/Podfile.lock', 'yarn.lock') }}
156156

157157
- name: Restore Xcode derived data from main cache
158-
if: ${{ steps.gate.outputs.needs-native-build == 'true' && steps.xcode-restore-cache.outputs.cache-hit != 'true' && github.ref_name != 'main' }}
158+
if: ${{ steps.gate.outputs.needs-native-build == 'true' && steps.xcode-restore-cache.outputs.cache-hit != 'true' && github.ref_name != 'main' && inputs.runner_provider != 'namespace' }}
159159
id: xcode-restore-cache-main
160160
# This will only restore the cache, not update it
161161
uses: cirruslabs/cache/restore@bba69c6578b863ad0398ad40567bd2ef70290fe0 # v4
@@ -165,6 +165,14 @@ jobs:
165165
ios/build
166166
key: ${{ runner.os }}-xcode-main-${{ env.XCODE_CACHE_VERSION }}-${{ hashFiles('ios/**/*.{h,m,mm,swift}', 'ios/**/Podfile.lock', 'yarn.lock') }}
167167

168+
# Namespace's built-in cocoapods preset handles the CocoaPods cache paths upstream.
169+
# Validated to work without a separate stale-state clear step (A/B tested 2026-05-11).
170+
- name: Configure Namespace iOS cache
171+
if: ${{ steps.gate.outputs.needs-native-build == 'true' && inputs.runner_provider == 'namespace' }}
172+
uses: namespacelabs/nscloud-cache-action@15799a6b54e5765f85b2aac25b3f0df43ed571c0 # v1.4.3
173+
with:
174+
cache: cocoapods
175+
168176
# Install Node.js, Xcode tools, and other iOS development dependencies.
169177
- name: Installing iOS Environment Setup
170178
if: ${{ steps.gate.outputs.needs-native-build == 'true' }}

.github/workflows/build-ios-upload-to-browserstack.yml

Lines changed: 17 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,11 @@ on:
2424
type: string
2525
description: 'Build variant for Bitrise (rc = release, exp = experimental)'
2626
default: 'rc'
27+
runner_provider:
28+
description: Runner provider forwarded from the caller
29+
required: false
30+
type: string
31+
default: current
2732
outputs:
2833
with-srp-ipa-uploaded:
2934
description: 'Whether the with-SRP IPA was successfully uploaded'
@@ -49,6 +54,14 @@ on:
4954
description: 'Optional description for this build run'
5055
required: false
5156
type: string
57+
runner_provider:
58+
description: Runner provider for this manual trial run
59+
required: false
60+
type: choice
61+
options:
62+
- current
63+
- namespace
64+
default: current
5265

5366
permissions:
5467
contents: read
@@ -65,7 +78,7 @@ env:
6578
jobs:
6679
check-builds-needed:
6780
name: Check if iOS builds are needed
68-
runs-on: ubuntu-latest
81+
runs-on: ${{ inputs.runner_provider == 'namespace' && 'namespace-profile-metamask-ci-linux' || 'ubuntu-latest' }}
6982
outputs:
7083
builds-needed: ${{ steps.check-builds.outputs.builds-needed }}
7184

@@ -84,7 +97,7 @@ jobs:
8497
8598
trigger-ios-with-srp-build:
8699
name: Trigger iOS with-SRP Build on Bitrise
87-
runs-on: ubuntu-latest
100+
runs-on: ${{ inputs.runner_provider == 'namespace' && 'namespace-profile-metamask-ci-linux' || 'ubuntu-latest' }}
88101
needs: [check-builds-needed]
89102
env:
90103
METAMASK_WORKFLOW: ${{ inputs.build_variant == 'exp' && 'build_ios_main_exp' || 'build_ios_main_rc' }}
@@ -221,7 +234,7 @@ jobs:
221234
222235
trigger-ios-without-srp-build:
223236
name: Trigger iOS without-SRP Build on Bitrise
224-
runs-on: ubuntu-latest
237+
runs-on: ${{ inputs.runner_provider == 'namespace' && 'namespace-profile-metamask-ci-linux' || 'ubuntu-latest' }}
225238
needs: [check-builds-needed]
226239
env:
227240
METAMASK_WORKFLOW: ${{ inputs.build_variant == 'exp' && 'build_ios_main_exp' || 'build_ios_main_rc' }}
@@ -345,7 +358,7 @@ jobs:
345358
346359
download-and-upload-to-browserstack:
347360
name: Download IPAs and Upload to BrowserStack
348-
runs-on: ubuntu-latest
361+
runs-on: ${{ inputs.runner_provider == 'namespace' && 'namespace-profile-metamask-ci-linux' || 'ubuntu-latest' }}
349362
needs: [check-builds-needed, trigger-ios-with-srp-build, trigger-ios-without-srp-build]
350363
if: (needs.trigger-ios-with-srp-build.result == 'success' || needs.trigger-ios-with-srp-build.result == 'partial_success') && (needs.trigger-ios-without-srp-build.result == 'success' || needs.trigger-ios-without-srp-build.result == 'partial_success')
351364
outputs:

.github/workflows/run-e2e-api-specs.yml

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,15 +5,30 @@ name: API Specs E2E Tests
55

66
on:
77
workflow_call:
8+
inputs:
9+
runner_provider:
10+
description: Runner provider forwarded from the caller
11+
required: false
12+
type: string
13+
default: current
814
workflow_dispatch:
15+
inputs:
16+
runner_provider:
17+
description: Runner provider for this manual trial run
18+
required: false
19+
type: choice
20+
options:
21+
- current
22+
- namespace
23+
default: current
924
pull_request:
1025
types: [opened, synchronize]
1126

1227
jobs:
1328
api-specs-ios:
1429
name: 'api-specs-ios'
1530
if: false
16-
runs-on: macos-latest-xlarge
31+
runs-on: ${{ inputs.runner_provider == 'namespace' && 'namespace-profile-metamask-ios-build' || 'macos-latest-xlarge' }}
1732
continue-on-error: true
1833

1934
env:

.github/workflows/update-e2e-fixtures.yml

Lines changed: 15 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,14 @@ on:
2222
description: 'PR number to update fixtures for'
2323
required: true
2424
type: string
25+
runner_provider:
26+
description: Runner provider for this manual trial run
27+
required: false
28+
type: choice
29+
options:
30+
- current
31+
- namespace
32+
default: current
2533

2634
jobs:
2735
# ── issue_comment dispatcher ──────────────────────────────────────────
@@ -34,7 +42,7 @@ jobs:
3442
github.event.issue.pull_request &&
3543
startsWith(github.event.comment.body, '@metamaskbot update-mobile-fixture')
3644
}}
37-
runs-on: ubuntu-latest
45+
runs-on: ${{ inputs.runner_provider == 'namespace' && 'namespace-profile-metamask-ci-linux' || 'ubuntu-latest' }}
3846
timeout-minutes: 5
3947
permissions:
4048
actions: write
@@ -76,7 +84,7 @@ jobs:
7684
is-fork-pull-request:
7785
name: Validate PR
7886
if: ${{ github.event_name == 'workflow_dispatch' }}
79-
runs-on: ubuntu-latest
87+
runs-on: ${{ inputs.runner_provider == 'namespace' && 'namespace-profile-metamask-ci-linux' || 'ubuntu-latest' }}
8088
timeout-minutes: 5
8189
outputs:
8290
IS_FORK: ${{ steps.is-fork.outputs.IS_FORK }}
@@ -93,7 +101,7 @@ jobs:
93101

94102
prepare:
95103
name: Prepare build artifacts
96-
runs-on: ubuntu-latest
104+
runs-on: ${{ inputs.runner_provider == 'namespace' && 'namespace-profile-metamask-ci-linux' || 'ubuntu-latest' }}
97105
timeout-minutes: 10
98106
needs: is-fork-pull-request
99107
if: ${{ needs.is-fork-pull-request.outputs.IS_FORK == 'false' }}
@@ -172,7 +180,7 @@ jobs:
172180
name: Export & update fixtures
173181
needs: [is-fork-pull-request, prepare]
174182
if: ${{ needs.prepare.result == 'success' && needs.is-fork-pull-request.outputs.IS_FORK == 'false' }}
175-
runs-on: ${{ startsWith(github.base_ref, 'release/') && fromJSON('["ghcr.io/cirruslabs/macos-runner:tahoe"]') || fromJSON('["ghcr.io/cirruslabs/macos-runner:tahoe", "low-priority"]') }}
183+
runs-on: ${{ inputs.runner_provider == 'namespace' && 'namespace-profile-metamask-ios-e2e' || (startsWith(github.base_ref, 'release/') && fromJSON('["ghcr.io/cirruslabs/macos-runner:tahoe"]') || fromJSON('["ghcr.io/cirruslabs/macos-runner:tahoe", "low-priority"]')) }}
176184
timeout-minutes: 30
177185

178186
env:
@@ -257,7 +265,7 @@ jobs:
257265

258266
commit-updated-fixtures:
259267
name: Commit the updated fixtures
260-
runs-on: ubuntu-latest
268+
runs-on: ${{ inputs.runner_provider == 'namespace' && 'namespace-profile-metamask-ci-linux' || 'ubuntu-latest' }}
261269
timeout-minutes: 10
262270
permissions:
263271
contents: write
@@ -335,7 +343,7 @@ jobs:
335343

336344
check-status:
337345
name: Check whether the fixture update succeeded
338-
runs-on: ubuntu-latest
346+
runs-on: ${{ inputs.runner_provider == 'namespace' && 'namespace-profile-metamask-ci-linux' || 'ubuntu-latest' }}
339347
timeout-minutes: 5
340348
if: ${{ !cancelled() && needs.is-fork-pull-request.outputs.IS_FORK == 'false' }}
341349
needs:
@@ -356,7 +364,7 @@ jobs:
356364
failure-comment:
357365
name: Comment about the fixture update failure
358366
if: ${{ !cancelled() && needs.is-fork-pull-request.outputs.IS_FORK == 'false' }}
359-
runs-on: ubuntu-latest
367+
runs-on: ${{ inputs.runner_provider == 'namespace' && 'namespace-profile-metamask-ci-linux' || 'ubuntu-latest' }}
360368
timeout-minutes: 5
361369
permissions:
362370
contents: read

.github/workflows/upload-to-testflight.yml

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,11 @@ on:
4444
required: false
4545
type: boolean
4646
default: true
47+
runner_provider:
48+
description: Runner provider forwarded from the caller
49+
required: false
50+
type: string
51+
default: current
4752

4853
permissions:
4954
contents: read
@@ -52,7 +57,7 @@ permissions:
5257
jobs:
5358
testflight-upload-summary:
5459
name: TestFlight upload summary
55-
runs-on: ubuntu-latest
60+
runs-on: ${{ inputs.runner_provider == 'namespace' && 'namespace-profile-metamask-ci-linux' || 'ubuntu-latest' }}
5661
steps:
5762
- name: Display TestFlight upload summary
5863
run: |
@@ -74,7 +79,7 @@ jobs:
7479
upload-ios-testflight:
7580
name: Upload iOS to TestFlight
7681
needs: [testflight-upload-summary]
77-
runs-on: ghcr.io/cirruslabs/macos-runner:tahoe-xl
82+
runs-on: ${{ inputs.runner_provider == 'namespace' && 'namespace-profile-metamask-ios-build' || 'ghcr.io/cirruslabs/macos-runner:tahoe-xl' }}
7883
steps:
7984
- name: Checkout repository
8085
uses: actions/checkout@v4

0 commit comments

Comments
 (0)