chore: decouple yarn install from build job#26369
Conversation
|
CLA Signature Action: All authors have signed the CLA. You may need to manually re-run the blocking PR check if it doesn't pass in a few minutes. |
|
…com:MetaMask/metamask-mobile into chore/decouple-yarn-install-in-github-build
…nstall-in-github-build
| submodules: recursive | ||
|
|
||
| # iOS: Use MetaMask's setup action (handles Node, Ruby, CocoaPods, Xcode). Signing is handled by Configure signing certificates below. | ||
| - name: Setup iOS environment |
There was a problem hiding this comment.
This seems to be duplicated, I don't think setup-node-modules.yml file needs to setup ios environment, although I'm not 100% sure
| - name: Setup iOS environment | ||
| if: inputs.platform == 'ios' | ||
| timeout-minutes: 15 | ||
| uses: MetaMask/github-tools/.github/actions/setup-e2e-env@v1 |
There was a problem hiding this comment.
We should use v1.7
| uses: MetaMask/github-tools/.github/actions/setup-e2e-env@v1 | |
| uses: MetaMask/github-tools/.github/actions/setup-e2e-env@v1.7 |
There was a problem hiding this comment.
Is it really needed since we run yarn setup:github-ci?
There was a problem hiding this comment.
removed and only add setup node and setup Ruby, will retest OTA
There was a problem hiding this comment.
Argh, it seems that it should be 1.7.0
| security delete-keychain "$KEYCHAIN_PATH" || true | ||
| fi | ||
|
|
||
| # iOS: Cache DerivedData (includes ModuleCache.noindex) to speed up Xcode builds |
There was a problem hiding this comment.
Is this something that could cache a build, and in the future bring the wrong build to the artifact? If yes, maybe it's a risk not worth taken, to speed up Xcode builds
| SECRETS_JSON: ${{ toJSON(secrets) }} | ||
| run: node scripts/validate-secrets-from-config.js | ||
|
|
||
| # iOS: Regenerate Pods and xcconfig on this runner so paths are correct (not from artifact). |
There was a problem hiding this comment.
Why paths wouldn't be or couldn't be correct here that we would need to re install pods?
There was a problem hiding this comment.
we don't run pod install in setup-node-modules because it has to be on the same runner when we build iOS. I've modified the comment.
| - name: Setup iOS environment | ||
| if: matrix.platform == 'ios' | ||
| timeout-minutes: 15 | ||
| uses: MetaMask/github-tools/.github/actions/setup-e2e-env@v1 |
There was a problem hiding this comment.
| uses: MetaMask/github-tools/.github/actions/setup-e2e-env@v1 | |
| uses: MetaMask/github-tools/.github/actions/setup-e2e-env@v1.7 |
There was a problem hiding this comment.
Wondering if running yarn install on this action make us vulnerable to post install scripts attacks
There was a problem hiding this comment.
Good catching, replacing it with Ruby + CocoaPods + Xcode
🔍 Smart E2E Test Selection
click to see 🤖 AI reasoning detailsE2E Test Selection: Key findings:
Why no E2E tests needed:
These CI/CD changes don't require E2E test validation as they don't affect the app functionality or the E2E test execution path. Performance Test Selection: |



Description
Summary
Splits dependency installation and project setup into a dedicated setup-dependencies job and passes node_modules (and related artifacts) to the build job via workflow artifacts. This keeps setup (no secrets) separate from the build (secrets, signing) and allows setup to run with retries and clear verification before the build consumes the artifact.
Test workflows:
flask-test: https://github.com/MetaMask/metamask-mobile/actions/runs/22597598384
main-exp: https://github.com/MetaMask/metamask-mobile/actions/runs/22597580993
main-test: https://github.com/MetaMask/metamask-mobile/actions/runs/22597573374
main-rc: https://github.com/MetaMask/metamask-mobile/actions/runs/22597559233
main-beta: https://github.com/MetaMask/metamask-mobile/actions/runs/22597549406
OTA workflow: https://github.com/MetaMask/metamask-mobile/actions/runs/22636342972/job/65602623716
Changelog
CHANGELOG entry: Separated yarn install from build job in build.yml
Related issues
Fixes:
Manual testing steps
Screenshots/Recordings
Before
After
Pre-merge author checklist
Pre-merge reviewer checklist
Note
Medium Risk
Restructures the GitHub Actions build pipeline to rely on cross-job artifacts and platform-specific runners, which can impact build reliability (especially around native deps/symlinks and iOS pod generation). No app runtime logic changes, but failures would block release builds.
Overview
CI build pipeline now separates dependency setup from signing/build.
build.ymladds a per-platformsetup-dependenciesjob that runsyarn install/yarn setup:github-ci(with retries) and uploads a tarballednode_modulesartifact; thebuildjob no longer runsyarn installand instead downloads, extracts, and verifies the artifact (including symlink checks) before building.Platform-specific build prep was adjusted. iOS now explicitly sets up Ruby/Xcode, installs CocoaPods in the build job (to match the runner), writes
ios/.xcode.env.localfor Xcode scripts, and cleans up any existing signing keychain before configuring signing.Reusable setup workflow expanded.
setup-node-modules.ymlgains inputs forplatform,build_name, submodule checkout, and tarball vs zip uploads; it runs on platform-specific runners when requested, applies build config for correct generated artifacts, and preserves symlinks via tarball uploads.builds.ymlremoves theQUICKNODE_BSC_URLandQUICKNODE_SEI_URLsecret mappings.Written by Cursor Bugbot for commit 6986e5b. This will update automatically on new commits. Configure here.