Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
15 changes: 10 additions & 5 deletions .github/workflows/build-android-e2e.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,11 +29,12 @@ on:
jobs:
build-android-apks:
name: Build Android E2E APKs
runs-on: ghcr.io/cirruslabs/ubuntu-runner-amd64:24.04-xl # Bumped from lg to xl to prevent Daemon disappearance issue (Daemon OOM issue in CI)
runs-on: ghcr.io/cirruslabs/ubuntu-runner-amd64:24.04-lg # Optimized for lg runner (48GB) with conservative memory settings
timeout-minutes: 40
env:
GRADLE_USER_HOME: /home/admin/_work/.gradle
CACHE_GENERATION: v1 # Increment this to bust the cache (v1, v2, v3, etc.)
YARN_ENABLE_GLOBAL_CACHE: 'true' # Enable Yarn global cache for faster installs
outputs:
apk-uploaded: ${{ steps.upload-apk.outcome == 'success' }}
apk-target-path: ${{ steps.determine-target-paths.outputs.apk-target-path }}
Expand All @@ -51,6 +52,7 @@ jobs:
echo "✅ System images installed"

- name: Setup Android Build Environment
timeout-minutes: 15
uses: MetaMask/github-tools/.github/actions/setup-e2e-env@v1
with:
platform: android
Expand Down Expand Up @@ -127,8 +129,7 @@ jobs:
if: ${{ steps.apk-cache-restore.outputs.cache-hit != 'true' }}
run: |
echo "🏗 Building Android E2E APKs..."
export NODE_OPTIONS="--max-old-space-size=8192"
# Use E2E gradle properties for GitHub Actions builds (gradle.properties.github)
export NODE_OPTIONS="--max-old-space-size=4096"
cp android/gradle.properties.github android/gradle.properties
yarn build:android:${{ inputs.build_type }}:e2e
shell: bash
Expand All @@ -141,7 +142,9 @@ jobs:
IGNORE_BOXLOGS_DEVELOPMENT: true
GITHUB_CI: 'true'
CI: 'true'
NODE_OPTIONS: '--max-old-space-size=8192'
NODE_OPTIONS: '--max-old-space-size=4096'
# Limit Metro workers to prevent OOM (each worker uses ~3GB)
METRO_MAX_WORKERS: '4'
BRIDGE_USE_DEV_APIS: 'true'
RAMP_INTERNAL_BUILD: 'true'
SEEDLESS_ONBOARDING_ENABLED: 'true'
Expand Down Expand Up @@ -191,12 +194,14 @@ jobs:
IGNORE_BOXLOGS_DEVELOPMENT: true
GITHUB_CI: 'true'
CI: 'true'
NODE_OPTIONS: '--max-old-space-size=8192'
NODE_OPTIONS: '--max-old-space-size=4096'
METRO_MAX_WORKERS: '4'
BRIDGE_USE_DEV_APIS: 'true'
RAMP_INTERNAL_BUILD: 'true'
SEEDLESS_ONBOARDING_ENABLED: 'true'
MM_NOTIFICATIONS_UI_ENABLED: 'true'
MM_SECURITY_ALERTS_API_ENABLED: 'true'
MM_POOLED_STAKING_ENABLED: 'true'
FEATURES_ANNOUNCEMENTS_ACCESS_TOKEN: ${{ secrets.FEATURES_ANNOUNCEMENTS_ACCESS_TOKEN }}
FEATURES_ANNOUNCEMENTS_SPACE_ID: ${{ secrets.FEATURES_ANNOUNCEMENTS_SPACE_ID }}
SEGMENT_WRITE_KEY_QA: ${{ secrets.SEGMENT_WRITE_KEY_QA }}
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/build-ios-e2e.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ jobs:
SEEDLESS_ONBOARDING_ENABLED: 'true'
MM_NOTIFICATIONS_UI_ENABLED: 'true'
MM_SECURITY_ALERTS_API_ENABLED: 'true'
YARN_ENABLE_GLOBAL_CACHE: 'true'
MM_POOLED_STAKING_ENABLED: 'true'
FEATURES_ANNOUNCEMENTS_ACCESS_TOKEN: ${{ secrets.FEATURES_ANNOUNCEMENTS_ACCESS_TOKEN }}
FEATURES_ANNOUNCEMENTS_SPACE_ID: ${{ secrets.FEATURES_ANNOUNCEMENTS_SPACE_ID }}
Expand Down Expand Up @@ -68,6 +69,7 @@ jobs:

# Install Node.js, Xcode tools, and other iOS development dependencies
- name: Installing iOS Environment Setup
timeout-minutes: 15
uses: MetaMask/github-tools/.github/actions/setup-e2e-env@v1
with:
platform: ios
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/run-e2e-workflow.yml
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,7 @@ jobs:
GOOGLE_SERVICES_B64_ANDROID: ${{ secrets.GOOGLE_SERVICES_B64_ANDROID }}
MM_SOLANA_E2E_TEST_SRP: ${{ secrets.MM_SOLANA_E2E_TEST_SRP }}
MM_INFURA_PROJECT_ID: ${{ secrets.MM_INFURA_PROJECT_ID }}
YARN_ENABLE_GLOBAL_CACHE: 'true' # Enable Yarn global cache for faster installs

steps:
- name: Checkout
Expand All @@ -107,6 +108,7 @@ jobs:
echo "✅ System images installed"

- name: Set up E2E environment
timeout-minutes: 15
uses: MetaMask/github-tools/.github/actions/setup-e2e-env@v1
with:
platform: ${{ inputs.platform }}
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ Expo is the fastest way to start developing. With the Expo framework, developers

#### Expo Environment Setup

[Install node, yarn v3 and watchman.](./docs/readme/expo-environment.md)
[Install node, yarn v4 and watchman.](./docs/readme/expo-environment.md)

#### Clone the project

Expand Down
17 changes: 7 additions & 10 deletions android/gradle.properties.github
Original file line number Diff line number Diff line change
@@ -1,24 +1,21 @@
# GitHub Actions-specific Gradle settings
# Optimized for E2E builds on GitHub Actions runners
# Gradle settings for GitHub Actions E2E builds (LG runner, 48GB RAM)

# JVM configuration
# Using 16GB heap to leave room for parallel workers and native memory
# ExitOnOutOfMemoryError: fail-fast on JVM heap exhaustion (does not catch OS OOM killer)
# file.encoding=UTF-8: ensure consistent charset across different runner configurations
org.gradle.jvmargs=-Xmx16g -XX:MaxMetaspaceSize=1g -XX:+UseG1GC -XX:G1HeapRegionSize=16m -XX:+UseStringDeduplication -XX:+OptimizeStringConcat -XX:+ExitOnOutOfMemoryError -Dfile.encoding=UTF-8
# JVM: 8GB heap to leave room for Metro workers + Kotlin daemon
org.gradle.jvmargs=-Xmx8g -XX:MaxMetaspaceSize=512m -XX:+UseG1GC -XX:G1HeapRegionSize=8m -XX:+UseStringDeduplication -XX:+OptimizeStringConcat -XX:+ExitOnOutOfMemoryError -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8

# Enable performance optimizations but limit parallelism to prevent OOM
org.gradle.parallel=true
org.gradle.configureondemand=true
org.gradle.caching=true
org.gradle.daemon=true
org.gradle.workers.max=6
# 4 workers to reduce concurrent memory pressure on 48GB runner
org.gradle.workers.max=4
org.gradle.vfs.watch=false

# CI-specific optimizations - enabled for GitHub Actions
kotlin.incremental=true
kotlin.incremental.android=true
kotlin.caching.enabled=true
# Kotlin daemon: 2GB cap to prevent memory contention
kotlin.daemon.jvmargs=-Xmx2g -XX:+UseG1GC -XX:+ExitOnOutOfMemoryError

# File system optimizations
org.gradle.vfs.verbose=false
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,16 @@ jest.mock('../../hooks/stream/usePerpsLiveAccount', () => ({
usePerpsLiveAccount: mockUsePerpsLiveAccount,
}));

// Mock usePerpsMarketFills to avoid Redux selector issues
jest.mock('../../hooks/usePerpsMarketFills', () => ({
usePerpsMarketFills: jest.fn(() => ({
fills: [],
isInitialLoading: false,
refresh: jest.fn(),
isRefreshing: false,
})),
}));

// Navigation mock functions
const mockNavigate = jest.fn();
const mockGoBack = jest.fn();
Expand Down
Loading
Loading