Skip to content

Commit ef93a06

Browse files
Merge branch 'main' into MMQA-1800-mock-polymarket-defaults
2 parents 4af8409 + 3fe0354 commit ef93a06

172 files changed

Lines changed: 7427 additions & 2351 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/CODEOWNERS

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -358,6 +358,7 @@ tests/websocket/ @MetaMask/qa
358358
.github/workflows/run-performance-e2e.yml @MetaMask/qa
359359
.github/workflows/run-performance-e2e-experimental.yml @MetaMask/qa
360360
.github/workflows/run-performance-e2e-release.yml @MetaMask/qa
361+
.github/workflows/run-system-tests.yml @MetaMask/qa
361362
.github/scripts/e2e-*.mjs @MetaMask/qa
362363
.github/scripts/collect-qa-stats.mjs @MetaMask/qa
363364
.github/scripts/generate-regression-slack-summary.mjs @MetaMask/qa

.github/actionlint.yaml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,11 @@ self-hosted-runner:
1515
- "ghcr.io/cirruslabs/ubuntu-runner-amd64:24.04-lg"
1616
- "ghcr.io/cirruslabs/ubuntu-runner-amd64:24.04-xl"
1717
- "low-priority"
18+
# Namespace runner profile labels (INFRA-3592). Format: namespace-profile-<profile-name>.
19+
- "namespace-profile-metamask-ci-linux"
20+
- "namespace-profile-metamask-android-build"
21+
- "namespace-profile-metamask-ios-build"
22+
- "namespace-profile-metamask-ios-e2e"
1823

1924
# Configuration variables in array of strings defined in your repository or
2025
# organization. `null` means disabling configuration variables check.

.github/actions/setup-e2e-env/action.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -116,9 +116,10 @@ runs:
116116
if: ${{ inputs.platform == 'android' && inputs.setup-simulator == 'true' && runner.os == 'Linux' }}
117117
uses: nick-fields/retry@ce71cc2ab81d554ebbe88c79ab5975992d79ba08 #v3.0.2
118118
with:
119-
timeout_minutes: 3
119+
timeout_minutes: 5
120120
max_attempts: 3
121121
retry_wait_seconds: 30
122+
retry_on: error
122123
on_retry_command: sudo apt-get clean
123124
command: |
124125
set -euo pipefail

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

Lines changed: 26 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -25,14 +25,19 @@ on:
2525
required: false
2626
default: 'qa'
2727
type: string
28+
runner_provider:
29+
description: Runner provider forwarded from the caller
30+
required: false
31+
type: string
32+
default: current
2833

2934
jobs:
3035
build-android-apks:
3136
name: Build Android E2E APKs
32-
runs-on: ghcr.io/cirruslabs/ubuntu-runner-amd64:24.04-lg # Optimized for lg runner (48GB) with conservative memory settings
37+
runs-on: ${{ inputs.runner_provider == 'namespace' && 'namespace-profile-metamask-android-build' || 'ghcr.io/cirruslabs/ubuntu-runner-amd64:24.04-lg' }} # Optimized for lg runner (48GB) with conservative memory settings
3338
timeout-minutes: 40
3439
env:
35-
GRADLE_USER_HOME: /home/admin/_work/.gradle
40+
GRADLE_USER_HOME: ${{ inputs.runner_provider == 'namespace' && '/home/runner/_work/.gradle' || '/home/admin/_work/.gradle' }}
3641
CACHE_GENERATION: v1 # Increment this to bust the cache (v1, v2, v3, etc.)
3742
YARN_ENABLE_GLOBAL_CACHE: 'true' # Enable Yarn global cache for faster installs
3843
outputs:
@@ -45,7 +50,20 @@ jobs:
4550
- name: Checkout repo
4651
uses: actions/checkout@v6
4752

53+
- name: Configure Namespace cache
54+
if: ${{ inputs.runner_provider == 'namespace' }}
55+
uses: namespacelabs/nscloud-cache-action@15799a6b54e5765f85b2aac25b3f0df43ed571c0 # v1
56+
with:
57+
path: |
58+
~/.cache/yarn
59+
.metamask
60+
node_modules
61+
.yarn/cache
62+
${{ env.GRADLE_USER_HOME }}/caches
63+
${{ env.GRADLE_USER_HOME }}/wrapper
64+
4865
- name: Restore .metamask folder (Foundry download cache for install:foundryup)
66+
if: ${{ inputs.runner_provider != 'namespace' }}
4967
uses: actions/cache@v4
5068
with:
5169
path: .metamask
@@ -100,6 +118,7 @@ jobs:
100118
fi
101119
102120
- name: Restore APKs matching fingerprint from branch cache
121+
if: ${{ inputs.runner_provider != 'namespace' }}
103122
id: apk-cache-restore
104123
# This action automatically updates the cache at the end of the workflow
105124
uses: cirruslabs/cache@bba69c6578b863ad0398ad40567bd2ef70290fe0 # v4
@@ -116,7 +135,7 @@ jobs:
116135
key: android-apk-${{ github.ref_name }}-${{ inputs.build_type }}-${{ env.CACHE_GENERATION }}-${{ steps.generate-fingerprint.outputs.fingerprint }}-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }}
117136

118137
- name: Restore APKs matching fingerprint from main cache
119-
if: ${{ steps.apk-cache-restore.outputs.cache-hit != 'true' && github.ref_name != 'main' }}
138+
if: ${{ inputs.runner_provider != 'namespace' && steps.apk-cache-restore.outputs.cache-hit != 'true' && github.ref_name != 'main' }}
120139
id: apk-cache-restore-main
121140
# This will only restore the cache, not update it
122141
uses: cirruslabs/cache/restore@bba69c6578b863ad0398ad40567bd2ef70290fe0 # v4
@@ -136,7 +155,7 @@ jobs:
136155
id: gradle-cache-restore
137156
# This action automatically updates the cache at the end of the workflow
138157
uses: cirruslabs/cache@bba69c6578b863ad0398ad40567bd2ef70290fe0 # v4
139-
if: ${{ steps.apk-cache-restore.outputs.cache-hit != 'true' && steps.apk-cache-restore-main.outputs.cache-hit != 'true' }}
158+
if: ${{ inputs.runner_provider != 'namespace' && steps.apk-cache-restore.outputs.cache-hit != 'true' && steps.apk-cache-restore-main.outputs.cache-hit != 'true' }}
140159
env:
141160
GRADLE_CACHE_VERSION: 1
142161
with:
@@ -154,7 +173,7 @@ jobs:
154173
- name: Restore Gradle dependencies from main cache
155174
# This will only restore the cache, not update it
156175
uses: cirruslabs/cache/restore@bba69c6578b863ad0398ad40567bd2ef70290fe0 # v4
157-
if: ${{ steps.apk-cache-restore.outputs.cache-hit != 'true' && steps.apk-cache-restore-main.outputs.cache-hit != 'true' && steps.gradle-cache-restore.outputs.cache-hit != 'true' && github.ref_name != 'main' }}
176+
if: ${{ inputs.runner_provider != 'namespace' && steps.apk-cache-restore.outputs.cache-hit != 'true' && steps.apk-cache-restore-main.outputs.cache-hit != 'true' && steps.gradle-cache-restore.outputs.cache-hit != 'true' && github.ref_name != 'main' }}
158177
env:
159178
GRADLE_CACHE_VERSION: 1
160179
with:
@@ -170,7 +189,7 @@ jobs:
170189
key: gradle-main-${{ env.GRADLE_CACHE_VERSION }}-${{ runner.os }}-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }}
171190

172191
- name: Build Android E2E APKs
173-
if: ${{ steps.apk-cache-restore.outputs.cache-hit != 'true' && steps.apk-cache-restore-main.outputs.cache-hit != 'true' }}
192+
if: ${{ inputs.runner_provider == 'namespace' || (steps.apk-cache-restore.outputs.cache-hit != 'true' && steps.apk-cache-restore-main.outputs.cache-hit != 'true') }}
174193
run: |
175194
echo "🏗 Building Android E2E APKs..."
176195
export NODE_OPTIONS="--max-old-space-size=4096"
@@ -213,7 +232,7 @@ jobs:
213232
MM_PREDICT_GTM_MODAL_ENABLED: 'false'
214233

215234
- name: Repack APK with JS updates using @expo/repack-app
216-
if: ${{ steps.apk-cache-restore.outputs.cache-hit == 'true' || steps.apk-cache-restore-main.outputs.cache-hit == 'true' }}
235+
if: ${{ inputs.runner_provider != 'namespace' && (steps.apk-cache-restore.outputs.cache-hit == 'true' || steps.apk-cache-restore-main.outputs.cache-hit == 'true') }}
217236
run: |
218237
echo "📦 Repacking APK with updated JavaScript bundle using @expo/repack-app..."
219238
# Use the optimized repack script which uses @expo/repack-app

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

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,11 @@ on:
1717
required: false
1818
default: 'qa'
1919
type: string
20+
runner_provider:
21+
description: Runner provider forwarded from the caller
22+
required: false
23+
type: string
24+
default: current
2025

2126
permissions:
2227
contents: read
@@ -25,7 +30,7 @@ permissions:
2530
jobs:
2631
build-ios-apps:
2732
name: Build iOS E2E Apps
28-
runs-on: ghcr.io/cirruslabs/macos-runner:tahoe-xl
33+
runs-on: ${{ inputs.runner_provider == 'namespace' && 'namespace-profile-metamask-ios-build' || 'ghcr.io/cirruslabs/macos-runner:tahoe-xl' }}
2934
outputs:
3035
artifacts-url: ${{ steps.set-artifacts-url.outputs.artifacts-url }}
3136
app-uploaded: ${{ steps.upload-app.outcome == 'success' }}

.github/workflows/build.yml

Lines changed: 27 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,11 @@ on:
2525
required: false
2626
type: boolean
2727
default: false
28+
runner_provider:
29+
description: Runner provider forwarded from the caller
30+
required: false
31+
type: string
32+
default: current
2833
outputs:
2934
build_name:
3035
description: 'build_name input passed to this workflow'
@@ -81,6 +86,14 @@ on:
8186
required: false
8287
type: boolean
8388
default: false
89+
runner_provider:
90+
description: Runner provider for this manual trial run
91+
required: true
92+
type: choice
93+
options:
94+
- current
95+
- namespace
96+
default: current
8497

8598
permissions:
8699
contents: read
@@ -104,7 +117,7 @@ jobs:
104117
prepare:
105118
needs: [update-build-version]
106119
if: ${{ always() && !failure() && !cancelled() }}
107-
runs-on: ubuntu-latest
120+
runs-on: ${{ inputs.runner_provider == 'namespace' && 'namespace-profile-metamask-ci-linux' || 'ubuntu-latest' }}
108121
outputs:
109122
github_environment: ${{ steps.config.outputs.github_environment }}
110123
secrets_json: ${{ steps.config.outputs.secrets_json }}
@@ -117,7 +130,6 @@ jobs:
117130
steps:
118131
- uses: actions/checkout@v4
119132
with:
120-
fetch-depth: 0
121133
ref: ${{ !inputs.skip_version_bump && needs.update-build-version.outputs.commit-hash || (inputs.source_branch || github.ref_name) }}
122134
- name: Setup Node.js
123135
uses: actions/setup-node@v4
@@ -165,6 +177,7 @@ jobs:
165177
upload-artifact: true
166178
artifact-name: node-modules-${{ inputs.build_name }}-${{ matrix.platform }}
167179
artifact-retention-days: 1
180+
runner_provider: ${{ inputs.runner_provider }}
168181

169182
# Build
170183
build:
@@ -175,7 +188,7 @@ jobs:
175188
matrix:
176189
platform: ${{ inputs.platform == 'both' && fromJSON('["android", "ios"]') || fromJSON(format('["{0}"]', inputs.platform)) }}
177190
# Android: Cirrus lg (large) runner for 8GB Gradle heap; iOS: Cirrus macOS Tahoe (has Xcode 26.x)
178-
runs-on: ${{ matrix.platform == 'ios' && 'ghcr.io/cirruslabs/macos-runner:tahoe-xl' || 'ghcr.io/cirruslabs/ubuntu-runner-amd64:24.04-lg' }}
191+
runs-on: ${{ inputs.runner_provider == 'namespace' && (matrix.platform == 'ios' && 'namespace-profile-metamask-ios-build' || 'namespace-profile-metamask-android-build') || (matrix.platform == 'ios' && 'ghcr.io/cirruslabs/macos-runner:tahoe-xl' || 'ghcr.io/cirruslabs/ubuntu-runner-amd64:24.04-lg') }}
179192
environment: ${{ needs.prepare.outputs.github_environment }}
180193
steps:
181194
- name: Validate version-bump commit
@@ -316,6 +329,16 @@ jobs:
316329
SECRETS_JSON: ${{ toJSON(secrets) }}
317330
run: node scripts/validate-secrets-from-config.js
318331

332+
- name: Restore CocoaPods specs cache (iOS)
333+
if: matrix.platform == 'ios'
334+
uses: actions/cache@v4
335+
with:
336+
path: ~/.cocoapods/repos
337+
key: ${{ runner.os }}-cocoapods-specs-${{ hashFiles('ios/Podfile.lock') }}
338+
restore-keys: |
339+
${{ runner.os }}-cocoapods-specs-
340+
continue-on-error: true
341+
319342
# iOS: Install Pods here so generated paths match this runner (setup-node-modules skips pod install with --no-install-pods).
320343
- name: Install CocoaPods dependencies (iOS)
321344
if: matrix.platform == 'ios'
@@ -508,7 +531,7 @@ jobs:
508531
name: Emit build metadata
509532
needs: [prepare, build]
510533
if: ${{ !failure() && !cancelled() && needs.prepare.result == 'success' && needs.build.result == 'success' }}
511-
runs-on: ubuntu-latest
534+
runs-on: ${{ inputs.runner_provider == 'namespace' && 'namespace-profile-metamask-ci-linux' || 'ubuntu-latest' }}
512535
outputs:
513536
checkout_ref: ${{ steps.meta.outputs.checkout_ref }}
514537
built_commit_sha: ${{ steps.meta.outputs.built_commit_sha }}
@@ -518,7 +541,6 @@ jobs:
518541
steps:
519542
- uses: actions/checkout@v4
520543
with:
521-
fetch-depth: 0
522544
ref: ${{ needs.prepare.outputs.checkout_ref_for_setup }}
523545

524546
- name: Setup Node.js

0 commit comments

Comments
 (0)