Skip to content
Merged
Show file tree
Hide file tree
Changes from 20 commits
Commits
Show all changes
66 commits
Select commit Hold shift + click to select a range
a8b8f77
feat(qa-build): update pipeline for generating ios and android builds
alucardzom Jul 25, 2025
dd0c3cb
chore: update token
alucardzom Jul 25, 2025
8bf6ad2
chore: test build now
alucardzom Jul 25, 2025
d419385
chore: test without prev steps
alucardzom Jul 25, 2025
252d39a
chore: add setup:github-ci command
alucardzom Jul 25, 2025
fcab962
chore: introduce command within the same step
alucardzom Jul 25, 2025
681540c
chore: run android pipeline
alucardzom Jul 25, 2025
a0f3b8c
chore: remove repeated input
alucardzom Jul 25, 2025
59042d0
chore: remove input
alucardzom Jul 25, 2025
274f3ab
chore: re enabled ios and launch both
alucardzom Jul 28, 2025
94b070c
chore: add missing env vars for the build step
alucardzom Jul 28, 2025
6aa089f
chore: simplify upload
alucardzom Jul 28, 2025
4be3d14
chore: build pods
alucardzom Jul 28, 2025
58b5872
chore: set node memory limit to avoid OOO issue
alucardzom Jul 28, 2025
a76d156
chore: added ipa app source map as optional
alucardzom Jul 29, 2025
d3facfb
chore: we need to run the env setup as figured
alucardzom Jul 29, 2025
4a41c3e
chore: improved legibility and structure
alucardzom Jul 29, 2025
de4e08e
chore: fix shellcheck
alucardzom Jul 29, 2025
3f87b95
chore: add quotes to github output id
alucardzom Jul 29, 2025
b55e5a3
chore: set proper name to artifacts
alucardzom Jul 29, 2025
eaf3096
chore: test self hosted nodes
alucardzom Jul 30, 2025
789052a
chore: test different branch for self hosted runners
alucardzom Jul 30, 2025
be0fca4
chore: test xl android instance for test
alucardzom Jul 31, 2025
84a0cdd
chore: test
alucardzom Jul 31, 2025
1164b83
chore: test some gradle limits for selfhosted
alucardzom Jul 31, 2025
468c92c
chore: remove maxpermsize option
alucardzom Jul 31, 2025
e5da965
chore: set memory limit
alucardzom Jul 31, 2025
2ffb430
chore: another limit
alucardzom Jul 31, 2025
793f039
chore: test limit memory gradle parallel arch
alucardzom Jul 31, 2025
f149418
chore: test xl self hosted
alucardzom Jul 31, 2025
ed308a0
chore: use xl mmsdk
alucardzom Jul 31, 2025
3090d41
chore: try to use gradle_opts variables
alucardzom Jul 31, 2025
75df401
gradle configs
makemesteaks Aug 1, 2025
e0d12df
more gradle configs
makemesteaks Aug 1, 2025
34677c4
gradle for bitrrise and gha
makemesteaks Aug 1, 2025
a50b491
caps
makemesteaks Aug 1, 2025
7b44107
try to override
makemesteaks Aug 1, 2025
8530500
add gradle args
makemesteaks Aug 1, 2025
dfdb84c
path
makemesteaks Aug 1, 2025
ab10e9f
copy gradle
makemesteaks Aug 1, 2025
0606b45
add gradle cache
makemesteaks Aug 1, 2025
c47f490
add only one build type
makemesteaks Aug 3, 2025
7aa42a3
Merge branch 'main' into ale/improve-qa-build-apps-job
makemesteaks Aug 4, 2025
4db514b
E2e with builds (#17897)
makemesteaks Aug 6, 2025
76e90a8
Merge branch 'main' into ale/improve-qa-build-apps-job
makemesteaks Aug 6, 2025
e76a617
Merge branch 'main' into ale/improve-qa-build-apps-job
makemesteaks Aug 6, 2025
657095f
update build gradle
makemesteaks Aug 6, 2025
6bd9738
typos
makemesteaks Aug 6, 2025
5fb546c
run tests only if build passes
makemesteaks Aug 6, 2025
4d12e33
variable reassign
makemesteaks Aug 6, 2025
37cca10
defensive check
makemesteaks Aug 6, 2025
8a4f905
no more test build
makemesteaks Aug 6, 2025
ab46324
run e2e fix
makemesteaks Aug 6, 2025
640bc08
comment ios
makemesteaks Aug 6, 2025
44a60e0
Revert "no more test build"
makemesteaks Aug 6, 2025
1ce7a5b
remove auto push
makemesteaks Aug 6, 2025
68855bb
correct file
makemesteaks Aug 7, 2025
8dc8505
emulator config changes test
makemesteaks Aug 7, 2025
af8127e
actionlint
makemesteaks Aug 7, 2025
e350bc3
actionlint
makemesteaks Aug 7, 2025
8a198b8
paths
makemesteaks Aug 7, 2025
b85588c
ignore
makemesteaks Aug 7, 2025
1b498fa
ignore
makemesteaks Aug 7, 2025
5a031dd
test
makemesteaks Aug 7, 2025
e9ce79a
actionlint
makemesteaks Aug 7, 2025
f749d93
add new vars for e2e
makemesteaks Aug 7, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
157 changes: 157 additions & 0 deletions .github/workflows/test-android-build-app.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,157 @@
name: Test Android Build QA App

on:
push:
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should be removed, added for testing into this branch

workflow_dispatch:
inputs:
retention_days:
description: 'Number of days to retain artifacts'
required: false
default: '7'
type: string

permissions:
contents: write
id-token: write

jobs:
android-build:
name: Test Android Build QA App
runs-on: ubuntu-latest
outputs:
artifacts-url: ${{ steps.set-artifacts-url.outputs.artifacts-url }}
apk-uploaded: ${{ steps.upload-apk.outcome == 'success' }}
aab-uploaded: ${{ steps.upload-aab.outcome == 'success' }}
sourcemap-uploaded: ${{ steps.upload-sourcemap.outcome == 'success' }}
steps:
# Get the source code from the repository
- name: Checkout repo
uses: actions/checkout@v4

# Install Android SDK, Node.js, and other Android development dependencies
- name: Installing Android Environment Setup
uses: MetaMask/github-tools/.github/actions/setup-e2e-env@e2e-env-actions
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This must be updated once MetaMask/github-tools#85 is merged.

with:
platform: android
setup-simulator: false

# Display Android development tools information for debugging
- name: Print Android Environment Info
run: |
echo "🔧 Node.js Version:"
node -v || echo "Node not found"
echo "Android Studio Version:"
/Applications/Android\ Studio.app/Contents/MacOS/studio --version || echo "Check manually via finder"
echo "🧶 Yarn Version:"
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Bug: Cross-Platform Path Error

The workflow attempts to check for Android Studio using a macOS-specific path (/Applications/Android\ Studio.app/Contents/MacOS/studio --version) on an Ubuntu runner, causing the check to always fail.

Fix in Cursor Fix in Web

yarn -v || echo "Yarn not found"
echo "📦 SDK Manager Version:"
sdkmanager --version || echo "sdkmanager not found"
echo "📱 ADB Version:"
adb version || echo "adb not found"
echo "🖥️ Emulator Version:"
emulator -version || echo "emulator not found"
echo "🧱 NDK Info:"
echo "NDK Dir: $ANDROID_SDK_ROOT/ndk/${NDK_VERSION:-unknown}"
if [ -n "${NDK_VERSION}" ] && [ -f "$ANDROID_SDK_ROOT/ndk/${NDK_VERSION}/source.properties" ]; then
grep "Pkg.Revision" "$ANDROID_SDK_ROOT/ndk/${NDK_VERSION}/source.properties" || echo "NDK version info not found"
else
echo "NDK not found or NDK_VERSION not set"
fi
echo "🔧 Checking for ndk-build:"
command -v ndk-build || echo "ndk-build not found in PATH"
echo "🔧 Checking for clang:"
command -v clang || echo "clang not found in PATH"
echo "🔧 Checking for llvm-ar:"
command -v llvm-ar || echo "llvm-ar not found in PATH"
echo "📱 Available AVD Devices:"
avdmanager list device || echo "avdmanager not found"
echo "📱 Available System Images:"
sdkmanager --list | grep "system-images;" || echo "No system images listed"
echo "🟢 Emulator Processes:"
pgrep -fl emulator || echo "No running emulator processes"
echo "📱 Connected Android Devices:"
adb devices || echo "adb devices failed"
shell: bash

# Run project setup and build the Android QA app (APK and AAB)
- name: Setup Android Environment
run: |
echo "🚀 Finishing Android Setup..."
yarn setup:github-ci --no-build-ios
echo "🏗 Building Android APP..."
yarn build:android:qa
shell: bash
env:
PLATFORM: android
METAMASK_ENVIRONMENT: qa
METAMASK_BUILD_TYPE: main
IS_TEST: true
IGNORE_BOXLOGS_DEVELOPMENT: true
GITHUB_CI: "true"
CI: "true"

SEGMENT_WRITE_KEY_QA: ${{ secrets.SEGMENT_WRITE_KEY_QA }}
SEGMENT_PROXY_URL_QA: ${{ secrets.SEGMENT_PROXY_URL_QA }}
SEGMENT_DELETE_API_SOURCE_ID_QA: ${{ secrets.SEGMENT_DELETE_API_SOURCE_ID_QA }}
SEGMENT_REGULATIONS_ENDPOINT_QA: ${{ secrets.SEGMENT_REGULATIONS_ENDPOINT_QA }}

MM_SENTRY_DSN_TEST: ${{ secrets.MM_SENTRY_DSN_TEST }}
MM_SENTRY_AUTH_TOKEN: ${{ secrets.MM_SENTRY_AUTH_TOKEN }}

MAIN_IOS_GOOGLE_CLIENT_ID_UAT: ${{ secrets.MAIN_IOS_GOOGLE_CLIENT_ID_UAT }}
MAIN_IOS_GOOGLE_REDIRECT_URI_UAT: ${{ secrets.MAIN_IOS_GOOGLE_REDIRECT_URI_UAT }}
MAIN_ANDROID_APPLE_CLIENT_ID_UAT: ${{ secrets.MAIN_ANDROID_APPLE_CLIENT_ID_UAT }}
MAIN_ANDROID_GOOGLE_CLIENT_ID_UAT: ${{ secrets.MAIN_ANDROID_GOOGLE_CLIENT_ID_UAT }}
MAIN_ANDROID_GOOGLE_SERVER_CLIENT_ID_UAT: ${{ secrets.MAIN_ANDROID_GOOGLE_SERVER_CLIENT_ID_UAT }}
GOOGLE_SERVICES_B64_IOS: ${{ secrets.GOOGLE_SERVICES_B64_IOS }}
GOOGLE_SERVICES_B64_ANDROID: ${{ secrets.GOOGLE_SERVICES_B64_ANDROID }}

# Upload the Android APK file for device installation and testing
- name: Upload Android APK Artifact
id: upload-apk
uses: actions/upload-artifact@v4
with:
name: app-qa-release.apk
path: android/app/build/outputs/apk/qa/release/app-qa-release.apk
retention-days: ${{ inputs.retention_days }}
if-no-files-found: error
continue-on-error: true

# Upload the Android App Bundle (AAB) for Play Store distribution
- name: Upload Android AAB Artifact
id: upload-aab
uses: actions/upload-artifact@v4
with:
name: app-qa-release.aab
path: android/app/build/outputs/bundle/qaRelease/app-qa-release.aab
retention-days: ${{ inputs.retention_days }}
if-no-files-found: warn
continue-on-error: true

# Upload source map file for crash debugging and error tracking
- name: Upload Android Source Map
id: upload-sourcemap
uses: actions/upload-artifact@v4
with:
name: index.android.bundle.map
path: sourcemaps/android/index.android.bundle.map
retention-days: ${{ inputs.retention_days }}
if-no-files-found: warn
continue-on-error: true

# Generate artifact download URL and display upload status summary
- name: Set Artifacts URL and Status
id: set-artifacts-url
run: |
ARTIFACTS_URL="https://github.com/${GITHUB_REPOSITORY}/actions/runs/${GITHUB_RUN_ID}"
echo "artifacts-url=${ARTIFACTS_URL}" >> "$GITHUB_OUTPUT"
echo "📦 Artifacts available at: ${ARTIFACTS_URL}"
echo ""
echo "Upload Status Summary:"
echo "- 🤖 APK: ${{ steps.upload-apk.outcome }}"
echo "- 📦 AAB Bundle: ${{ steps.upload-aab.outcome }}"
echo "- 📦 Source Map: ${{ steps.upload-sourcemap.outcome }}"

env:
GITHUB_REPOSITORY: "${{ github.repository }}"
GITHUB_RUN_ID: "${{ github.run_id }}"
170 changes: 170 additions & 0 deletions .github/workflows/test-ios-build-app.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,170 @@
name: Test iOS Build QA App

on:
push:
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should be removed, added for testing into this branch

workflow_dispatch:
inputs:
retention_days:
description: 'Number of days to retain the uploaded artifacts'
required: false
default: '7'
type: string

permissions:
contents: write
id-token: write

jobs:
ios-build:
name: Test iOS QA Build App
runs-on: macos-15
outputs:
artifacts-url: ${{ steps.set-artifacts-url.outputs.artifacts-url }}
app-uploaded: ${{ steps.upload-app.outcome == 'success' }}
ipa-uploaded: ${{ steps.upload-ipa.outcome == 'success' }}
archive-uploaded: ${{ steps.upload-archive.outcome == 'success' }}
sourcemap-uploaded: ${{ steps.upload-sourcemap.outcome == 'success' }}
env:
GITHUB_CI: "true" # ✅ This ensures it's available during pod install
steps:
# Get the source code from the repository
- name: Checkout repo
uses: actions/checkout@v4

# Display system information for debugging purposes
- name: Detect CPU architecture
run: |
echo "Arch: $(uname -m)"
if [[ "$(uname -m)" == "x86_64" ]]; then
echo "Detected Intel runner"
else
echo "Detected Apple Silicon runner"
fi

- name: Print system resources
run: |
echo "🧠 Memory info:"
vm_stat
echo ""
echo "💻 CPU info:"
sysctl -n hw.ncpu
sysctl -n hw.memsize | awk '{ byte =$1 /1024/1024/1024; print byte " GB" }'
shell: bash

# Install Node.js, Xcode tools, and other iOS development dependencies
- name: Installing iOS Environment Setup
uses: MetaMask/github-tools/.github/actions/setup-e2e-env@e2e-env-actions
with:
platform: ios
setup-simulator: false

- name: Print iOS tool versions
run: |
echo "🔧 Node.js Version:"
node -v || echo "Node not found"
echo "🧶 Yarn Version:"
yarn -v || echo "Yarn not found"
echo "📦 CocoaPods Version:"
pod --version || echo "CocoaPods not found"
echo "🛠️ Xcode Path:"
xcode-select -p || echo "Xcode not found"
echo "📱 Booted iOS Simulators:"
xcrun simctl list | grep Booted || echo "No booted simulators found"
shell: bash

# Run project setup and build the iOS QA app for simulator
- name: Setup iOS Environment
run: |
echo "🚀 Finishing iOS Setup..."
yarn setup:github-ci --build-ios --no-build-android
echo "🏗 Building iOS APP..."
yarn build:ios:qa
shell: bash
env:
PLATFORM: ios
METAMASK_ENVIRONMENT: qa
METAMASK_BUILD_TYPE: main
IS_TEST: true
IGNORE_BOXLOGS_DEVELOPMENT: true
GITHUB_CI: "true"
CI: "true"

NODE_OPTIONS: "--max_old_space_size=4096" # Increase memory limit for build, specially on GH Runners

SEGMENT_WRITE_KEY_QA: ${{ secrets.SEGMENT_WRITE_KEY_QA }}
SEGMENT_PROXY_URL_QA: ${{ secrets.SEGMENT_PROXY_URL_QA }}
SEGMENT_DELETE_API_SOURCE_ID_QA: ${{ secrets.SEGMENT_DELETE_API_SOURCE_ID_QA }}
SEGMENT_REGULATIONS_ENDPOINT_QA: ${{ secrets.SEGMENT_REGULATIONS_ENDPOINT_QA }}

MM_SENTRY_DSN_TEST: ${{ secrets.MM_SENTRY_DSN_TEST }}
MM_SENTRY_AUTH_TOKEN: ${{ secrets.MM_SENTRY_AUTH_TOKEN }}

MAIN_IOS_GOOGLE_CLIENT_ID_UAT: ${{ secrets.MAIN_IOS_GOOGLE_CLIENT_ID_UAT }}
MAIN_IOS_GOOGLE_REDIRECT_URI_UAT: ${{ secrets.MAIN_IOS_GOOGLE_REDIRECT_URI_UAT }}
MAIN_ANDROID_APPLE_CLIENT_ID_UAT: ${{ secrets.MAIN_ANDROID_APPLE_CLIENT_ID_UAT }}
MAIN_ANDROID_GOOGLE_CLIENT_ID_UAT: ${{ secrets.MAIN_ANDROID_GOOGLE_CLIENT_ID_UAT }}
MAIN_ANDROID_GOOGLE_SERVER_CLIENT_ID_UAT: ${{ secrets.MAIN_ANDROID_GOOGLE_SERVER_CLIENT_ID_UAT }}
GOOGLE_SERVICES_B64_IOS: ${{ secrets.GOOGLE_SERVICES_B64_IOS }}
GOOGLE_SERVICES_B64_ANDROID: ${{ secrets.GOOGLE_SERVICES_B64_ANDROID }}

# Upload the iOS .app file that works in simulators (no certificates needed)
- name: Upload iOS APP Artifact (Simulator)
id: upload-app
uses: actions/upload-artifact@v4
with:
name: MetaMask-QA.app
path: ios/build/Build/Products/Release-iphonesimulator/MetaMask-QA.app
retention-days: ${{ inputs.retention_days }}
if-no-files-found: error
continue-on-error: true

# Upload iOS .ipa file for device installation (requires certificates - may not exist)
- name: Upload iOS IPA Artifact (Device)
id: upload-ipa
uses: actions/upload-artifact@v4
with:
name: MetaMask-QA.ipa
path: ios/build/output/MetaMask-QA.ipa
retention-days: ${{ inputs.retention_days }}
if-no-files-found: error
continue-on-error: true

# Upload iOS .xcarchive file for debugging and re-signing (requires certificates - may not exist)
- name: Upload iOS Archive Artifact
id: upload-archive
uses: actions/upload-artifact@v4
with:
name: MetaMask-QA.xcarchive
path: ios/build/MetaMask-QA.xcarchive
retention-days: ${{ inputs.retention_days }}
if-no-files-found: error
continue-on-error: true

# Upload source map file for crash debugging and error tracking if exists
- name: Upload iOS Source Map
id: upload-sourcemap
uses: actions/upload-artifact@v4
with:
name: index.js.map
path: sourcemaps/ios/index.js.map
retention-days: ${{ inputs.retention_days }}
if-no-files-found: error
continue-on-error: true

# Generate artifact download URL and display upload status summary
- name: Set Artifacts URL and Status
id: set-artifacts-url
run: |
ARTIFACTS_URL="https://github.com/${GITHUB_REPOSITORY}/actions/runs/${GITHUB_RUN_ID}"
echo "artifacts-url=${ARTIFACTS_URL}" >> "$GITHUB_OUTPUT"
echo "📦 Artifacts available at: ${ARTIFACTS_URL}"
echo ""
echo "Upload Status Summary:"
echo "-  APP (Simulator): ${{ steps.upload-app.outcome }}"
echo "-  IPA (Device): ${{ steps.upload-ipa.outcome }}"
echo "-  Archive: ${{ steps.upload-archive.outcome }}"
echo "-  Source Map: ${{ steps.upload-sourcemap.outcome }}"

env:
GITHUB_REPOSITORY: "${{ github.repository }}"
GITHUB_RUN_ID: "${{ github.run_id }}"
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
"format": "prettier '**/*.{js,ts,tsx,json,feature}' --write",
"format:check:changed": "git diff --name-only --diff-filter=ACM HEAD~1 | { grep -E '\\.(js|ts|tsx|json|feature)$' || true; } | xargs --no-run-if-empty prettier --check",
"setup": "yarn clean && node scripts/setup.mjs",
"setup:github-ci": "node scripts/setup.mjs --build-on-github-ci",
"setup:flask": "export METAMASK_BUILD_TYPE='flask' && yarn setup",
"setup:expo": "yarn clean && node scripts/setup.mjs --no-build-ios --no-build-android",
"setup:e2e": "cd wdio && yarn install",
Expand Down
20 changes: 17 additions & 3 deletions scripts/setup.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@ let BUILD_IOS = IS_OSX;
let IS_NODE = false;
let BUILD_ANDROID = true
let INSTALL_PODS;
// GitHub CI pipeline flag - defaults to false
let GITHUB_CI = false;
const args = process.argv.slice(2) || [];
for (const arg of args) {
switch (arg) {
Expand All @@ -32,6 +34,9 @@ for (const arg of args) {
case '--no-build-android':
BUILD_ANDROID = false
continue;
case '--build-on-github-ci':
GITHUB_CI = true;
continue;
default:
throw new Error(`Unrecognized CLI arg ${arg}`);
}
Expand Down Expand Up @@ -121,7 +126,10 @@ const buildPpomTask = {
[
{
title: 'Clean',
task: async () => {
task: async (_, task) => {
if (GITHUB_CI) {
return task.skip('Skipping clean in GitHub CI.');
}
await $ppom`yarn clean`;
},
},
Expand Down Expand Up @@ -163,13 +171,19 @@ const setupIosTask = {
const tasks = [
{
title: 'Install bundler gem',
task: async () => {
task: async (_, task) => {
if (GITHUB_CI) {
return task.skip('Skipping bundler gem installation in GitHub CI.');
}
await $`gem install bundler -v 2.5.8`;
},
},
{
title: 'Install gems',
task: async () => {
task: async (_, task) => {
if (GITHUB_CI) {
return task.skip('Skipping gems installation in GitHub CI.');
}
await $`yarn gem:bundle:install`;
},
},
Expand Down
Loading