Skip to content

Commit 65cf761

Browse files
authored
Merge branch 'main' into chore/udate-assets-controllers-tokensList
2 parents a20f9b0 + d55db0f commit 65cf761

47 files changed

Lines changed: 1558 additions & 347 deletions

Some content is hidden

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

.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/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: 17 additions & 3 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 }}
@@ -164,6 +177,7 @@ jobs:
164177
upload-artifact: true
165178
artifact-name: node-modules-${{ inputs.build_name }}-${{ matrix.platform }}
166179
artifact-retention-days: 1
180+
runner_provider: ${{ inputs.runner_provider }}
167181

168182
# Build
169183
build:
@@ -174,7 +188,7 @@ jobs:
174188
matrix:
175189
platform: ${{ inputs.platform == 'both' && fromJSON('["android", "ios"]') || fromJSON(format('["{0}"]', inputs.platform)) }}
176190
# Android: Cirrus lg (large) runner for 8GB Gradle heap; iOS: Cirrus macOS Tahoe (has Xcode 26.x)
177-
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') }}
178192
environment: ${{ needs.prepare.outputs.github_environment }}
179193
steps:
180194
- name: Validate version-bump commit
@@ -517,7 +531,7 @@ jobs:
517531
name: Emit build metadata
518532
needs: [prepare, build]
519533
if: ${{ !failure() && !cancelled() && needs.prepare.result == 'success' && needs.build.result == 'success' }}
520-
runs-on: ubuntu-latest
534+
runs-on: ${{ inputs.runner_provider == 'namespace' && 'namespace-profile-metamask-ci-linux' || 'ubuntu-latest' }}
521535
outputs:
522536
checkout_ref: ${{ steps.meta.outputs.checkout_ref }}
523537
built_commit_sha: ${{ steps.meta.outputs.built_commit_sha }}

0 commit comments

Comments
 (0)