Skip to content
Open
Changes from 1 commit
Commits
Show all changes
96 commits
Select commit Hold shift + click to select a range
a75fa8b
e2e-env-action
jake-perkins Jul 9, 2025
ab67bec
add more deps
jake-perkins Jul 9, 2025
22a7b88
fix cursor bug
jake-perkins Jul 9, 2025
610d928
new action shas
jake-perkins Jul 10, 2025
6ebb0f3
yarn install
jake-perkins Jul 10, 2025
f6e583d
yarn cache
jake-perkins Jul 10, 2025
e4322a4
cache act
jake-perkins Jul 10, 2025
4a81330
fix sim device
jake-perkins Jul 10, 2025
bc2f52f
bundler-cache
jake-perkins Jul 10, 2025
27eed96
try yarn.lock perf fix
jake-perkins Jul 11, 2025
c9e4d1e
cocoapods caching
jake-perkins Jul 11, 2025
f5c4f53
android tuning
jake-perkins Jul 11, 2025
860c7d4
tuning
jake-perkins Jul 11, 2025
4898cab
license-accepts
jake-perkins Jul 11, 2025
8b76ea8
foundry agnostic
jake-perkins Jul 11, 2025
f1008f7
setup
jake-perkins Jul 11, 2025
9884d8a
foundry ubuntu-mac-agnostic
jake-perkins Jul 11, 2025
682cafb
act
jake-perkins Jul 11, 2025
6a1ff90
foundry
jake-perkins Jul 11, 2025
38bd065
foundry android
jake-perkins Jul 11, 2025
2f5e2a6
remover chmod
jake-perkins Jul 11, 2025
a3ea5d4
act
jake-perkins Jul 11, 2025
8f3fdcb
act
jake-perkins Jul 11, 2025
c7d9987
act
jake-perkins Jul 11, 2025
90d1bd2
foundry
jake-perkins Jul 11, 2025
bfd20d8
act
jake-perkins Jul 11, 2025
6d49bac
cfgs
jake-perkins Jul 11, 2025
b2e0ef3
ndk setup
jake-perkins Jul 11, 2025
c35dbc6
ndk
jake-perkins Jul 11, 2025
9e75e06
ndk
jake-perkins Jul 11, 2025
dda3178
act
jake-perkins Jul 11, 2025
03cd24b
licenses
jake-perkins Jul 11, 2025
4b4e46f
android tools
jake-perkins Jul 11, 2025
02ff9a9
e2e
jake-perkins Jul 11, 2025
5695370
act
jake-perkins Jul 11, 2025
f399c35
act
jake-perkins Jul 11, 2025
4d87552
upgrade default xcode-version
jake-perkins Jul 11, 2025
929ddaa
e2e
jake-perkins Jul 11, 2025
d9de05d
lint
jake-perkins Jul 11, 2025
18421e8
android-simulator
jake-perkins Jul 11, 2025
93cf96a
android-act
jake-perkins Jul 11, 2025
db78229
fix emu bug
jake-perkins Jul 11, 2025
37051d0
act
jake-perkins Jul 11, 2025
dade476
act
jake-perkins Jul 11, 2025
8529256
emulator bugs
jake-perkins Jul 11, 2025
3b49d84
android-sim
jake-perkins Jul 11, 2025
a4ca242
act
jake-perkins Jul 11, 2025
b1867a9
act
jake-perkins Jul 11, 2025
860e85f
env
jake-perkins Jul 11, 2025
032380e
update android default abi
jake-perkins Jul 11, 2025
eea10a6
act
jake-perkins Jul 11, 2025
1366275
linting
jake-perkins Jul 12, 2025
1a08796
Merge branch 'main' into e2e-env-actions
jake-perkins Jul 12, 2025
367c013
always lay out simulator cfgs
jake-perkins Jul 15, 2025
d7a349b
E2e ubuntu runners (#87)
makemesteaks Jul 16, 2025
4459e30
E2e env actions keystore (#90)
jake-perkins Jul 18, 2025
4ee8ff1
keystore-integrations
jake-perkins Jul 18, 2025
9e04cea
keystores
jake-perkins Jul 18, 2025
aa884d6
keystore
jake-perkins Jul 18, 2025
a4d8ac3
manage node version
jake-perkins Jul 18, 2025
a3cd1cb
Emulator configs (#88)
makemesteaks Jul 18, 2025
b748908
remove cocoapods caching
jake-perkins Jul 18, 2025
8553525
fmt
jake-perkins Jul 18, 2025
8f5b198
self hosted
makemesteaks Jul 29, 2025
a1f7d18
test
makemesteaks Jul 29, 2025
2ead7cb
fail fast
makemesteaks Jul 29, 2025
5b810c9
remove ndk because its already in the runner
makemesteaks Jul 29, 2025
060107e
targets
jake-perkins Aug 4, 2025
d378d7d
fix-act
jake-perkins Aug 5, 2025
b3b5adf
slimmer pipeline
makemesteaks Jul 30, 2025
ef89e45
avd changes
makemesteaks Aug 7, 2025
c35da38
add pod vendor to path
jake-perkins Aug 28, 2025
5a428da
ruby/gem troubleshooting
jake-perkins Aug 28, 2025
4364187
pod verify
jake-perkins Aug 28, 2025
93a7c6e
binstub
jake-perkins Aug 28, 2025
1c024c7
binstub
jake-perkins Aug 28, 2025
9a1f3b3
binstub
jake-perkins Aug 29, 2025
b622c5f
configs
jake-perkins Aug 29, 2025
c526726
supress partition list output
jake-perkins Aug 29, 2025
3447281
ci
jake-perkins Sep 2, 2025
a345f7c
debugging
jake-perkins Sep 2, 2025
b532e7f
keystore debugs
jake-perkins Sep 2, 2025
4f03564
configs
jake-perkins Sep 2, 2025
ed3592d
compare fingerprints
jake-perkins Sep 2, 2025
51c3ae9
default-chain
jake-perkins Sep 2, 2025
4eec245
codesignign config
jake-perkins Sep 2, 2025
e95f53d
test ssl
makemesteaks Sep 3, 2025
6ac80cb
remove debugging
jake-perkins Sep 3, 2025
394f14c
keychain
jake-perkins Sep 3, 2025
5906de6
chore: retries (#122)
makemesteaks Sep 11, 2025
fb91d27
Revert "chore: retries (#122)"
makemesteaks Sep 11, 2025
9e5ee8b
feat(INFRA-2932): add retry to yarn commands self hosted (#126)
bsgrigorov Sep 17, 2025
2f1cdf9
add action to yarn v3 of setup-e2e-env
tommasini Sep 17, 2025
197371d
shell bash added
tommasini Sep 17, 2025
1d567b7
fix setup e2e env var w yarn v3
tommasini Sep 17, 2025
f1d2c36
chore: add retry to corepack step
alucardzom Sep 18, 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
Prev Previous commit
Next Next commit
add action to yarn v3 of setup-e2e-env
  • Loading branch information
tommasini committed Sep 17, 2025
commit 2f1cdf98c692691e78b21b1334a51a552f2ee22b
339 changes: 339 additions & 0 deletions .github/actions/setup-e2e-env-yarn-v3/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,339 @@
name: 'Setup E2E Test Environment (Yarn v3)'
description: 'Sets up the environment for running E2E tests with Yarn v3 support'
inputs:
platform:
description: 'Platform (ios or android)'
required: true
node-version:
description: 'Node.js version'
required: false
default: '20.18.0'
yarn-version:
description: Yarn version to use with Corepack
required: false
default: '3.8.7'
setup-simulator:
description: 'Whether to setup simulator/emulator'
required: false
default: 'false'
bundler-version:
description: 'Bundler version to use (only for iOS)'
required: false
default: '2.5.8'
cache-prefix:
description: 'Cache key prefix'
required: false
default: 'e2e'
ruby-version:
description: Ruby version to use (only for iOS)
required: false
default: '3.1'
xcode-version:
description: Xcode version to select (e.g., 16.2)
required: false
default: '16.2'
jdk-version:
description: JDK version to use (only for Android)
required: false
default: '17'
jdk-distribution:
description: JDK distribution to use (only for Android)
required: false
default: 'temurin'
ndk-version:
description: NDK version to use (only for Android)
required: false
default: '26.1.10909125'
foundry-version:
description: Foundry version to install
required: false
default: 'v1.2.3'
android-avd-name:
description: 'Name of AVD to create and boot (for Android)'
required: false
default: 'test_e2e_avd'
android-device:
description: 'AVD device profile (e.g. "pixel")'
required: false
default: 'pixel'
android-api-level:
description: 'Android API level to use (e.g. "34")'
required: false
default: '34'
android-abi:
description: 'System architecture ABI for the Android system image (e.g. x86_64, arm64-v8a, armeabi-v7a)'
required: false
default: 'x86_64'
configure-keystores:
description: 'Whether to configure keystores for E2E tests'
required: false
default: 'true'
keystore-role-to-assume:
description: 'AWS IAM role to assume for keystore configuration'
required: false
default: 'arn:aws:iam::363762752069:role/metamask-mobile-build-signer-qa'
target:
description: 'target for which the keystore is being configured (e.g., qa, flask, main)'
required: false
default: 'qa'


runs:
using: 'composite'
steps:
## Common Setup ##
- run: echo "Setup E2E Environment (Yarn v3) started"
shell: bash

- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: ${{ inputs.node-version }}

## Yarn v3 Setup & Cache Management

- name: Corepack
id: corepack
run: corepack enable && corepack prepare yarn@${{ inputs.yarn-version }} --activate
shell: bash

- name: Restore Yarn cache
uses: actions/cache@v4
with:
path: |
.yarn/cache
.yarn/install-state.gz
node_modules
key: ${{ inputs.cache-prefix }}-yarn-v3-${{ inputs.platform }}-${{ runner.os }}-${{ hashFiles('yarn.lock', '.yarnrc.yml') }}
restore-keys: |
${{ inputs.cache-prefix }}-yarn-v3-${{ inputs.platform }}-${{ runner.os }}-

- name: Install JavaScript dependencies with retry
id: yarn-install
uses: nick-fields/retry@ce71cc2ab81d554ebbe88c79ab5975992d79ba08
with:
timeout_minutes: 10
max_attempts: 3
retry_wait_seconds: 30
command: |
if ! yarn install --immutable; then
echo "Immutable install failed, likely due to checksum mismatch. Attempting to update yarn.lock..."
yarn install
echo "yarn.lock updated. Verifying with immutable install..."
yarn install --immutable
fi
env:
NODE_OPTIONS: --max-old-space-size=4096 # Increase memory limit for Node.js due to large dependencies

- name: Verify Detox CLI
run: yarn detox --version

- name: Install Foundry
shell: bash
run: |
echo "Installing Foundry via foundryup..."

export FOUNDRY_DIR="${XDG_CONFIG_HOME:-$HOME/.config}/.foundry"
export FOUNDRY_BIN="$FOUNDRY_DIR/bin"

mkdir -p "$FOUNDRY_BIN"

curl -sL https://raw.githubusercontent.com/foundry-rs/foundry/master/foundryup/foundryup -o "$FOUNDRY_BIN/foundryup"
chmod +x "$FOUNDRY_BIN/foundryup"

echo "$FOUNDRY_BIN" >> "$GITHUB_PATH"

"$FOUNDRY_BIN/foundryup"

## IOS Setup ##
- name: Configure iOS Signing Certificates
if: ${{ inputs.platform == 'ios' && inputs.configure-keystores == 'true' }}
uses: MetaMask/github-tools/.github/actions/configure-keystore@e2e-env-actions
with:
aws-role-to-assume: ${{ inputs.keystore-role-to-assume }}
aws-region: 'us-east-2'
platform: 'ios'
target: ${{ inputs.target }}

## Ruby Setup & Cache Management
- name: Setup Ruby
if: ${{ inputs.platform == 'ios' }}
uses: ruby/setup-ruby@a4effe49ee8ee5b8b5091268c473a4628afb5651
with:
ruby-version: ${{ inputs.ruby-version }}

# Install Bundler first
- name: Install bundler
if: ${{ inputs.platform == 'ios' }}
run: gem install bundler -v ${{ inputs.bundler-version }}
shell: bash

# Restore cached Ruby gems
- name: Restore Bundler cache
if: ${{ inputs.platform == 'ios' }}
uses: actions/cache@v4
with:
path: ios/vendor/bundle
key: ${{ inputs.cache-prefix }}-bundler-${{ inputs.platform }}-${{ runner.os }}-${{ hashFiles('ios/Gemfile.lock') }}
restore-keys: |
${{ inputs.cache-prefix }}-bundler-${{ inputs.platform }}-${{ runner.os }}-

# Configure bundler to use a specific path for gem installation
- name: Configure bundler install path
if: ${{ inputs.platform == 'ios' }}
run: bundle config set path 'vendor/bundle'
working-directory: ios
shell: bash

# Install Ruby gems into ios/vendor/bundle ( cache management & awareness )
- name: Install Ruby gems via bundler
if: ${{ inputs.platform == 'ios' }}
run: bundle install
working-directory: ios
shell: bash

# Select Xcode version
- name: Select Xcode version
if: ${{ inputs.platform == 'ios' }}
run: sudo xcode-select -s /Applications/Xcode_${{ inputs.xcode-version }}.app/Contents/Developer
shell: bash

# Restore CocoaPods cache
# - name: Restore CocoaPods cache
# if: ${{ inputs.platform == 'ios'}}
# uses: actions/cache@v4
# with:
# path: ios/Pods
# key: ${{ inputs.cache-prefix }}-pods-${{ inputs.platform }}-${{ runner.os }}-${{ hashFiles('ios/Podfile.lock') }}
# restore-keys: |
# ${{ inputs.cache-prefix }}-pods-${{ inputs.platform }}-${{ runner.os }}-

# Install CocoaPods w/ cached bundler environment
- name: Install CocoaPods via bundler
if: ${{ inputs.platform == 'ios' }}
run: bundle exec pod install --repo-update --verbose
working-directory: ios
shell: bash

- name: Install applesimutils
if: ${{ inputs.platform == 'ios' }}
run: brew tap wix/brew && brew install applesimutils
shell: bash

- name: Check simutils
if: ${{ inputs.platform == 'ios' }}
run: xcrun simctl list devices
shell: bash

## Android Setup ##

## JDK Setup
- name: Setup Java
if: ${{ inputs.platform == 'android' }}
uses: actions/setup-java@c5195efecf7bdfc987ee8bae7a71cb8b11521c00
with:
java-version: ${{ inputs.jdk-version }}
distribution: ${{ inputs.jdk-distribution }}

- name: Configure Android Signing Certificates
if: ${{ inputs.platform == 'android' && inputs.configure-keystores == 'true' }}
uses: MetaMask/github-tools/.github/actions/configure-keystore@e2e-env-actions
with:
aws-role-to-assume: ${{ inputs.keystore-role-to-assume }}
aws-region: 'us-east-2'
platform: 'android'
target: ${{ inputs.target }}

- name: Enable KVM group perms (Ubuntu only)
if: ${{ inputs.platform == 'android' && runner.os == 'Linux' }}
run: |
echo 'KERNEL=="kvm", GROUP="kvm", MODE="0666", OPTIONS+="static_node=kvm"' | sudo tee /etc/udev/rules.d/99-kvm4all.rules
sudo udevadm control --reload-rules
sudo udevadm trigger --name-match=kvm
shell: bash

## Android SDK Setup

- name: Install required emulator dependencies
if: ${{ inputs.platform == 'android' && runner.os == 'Linux' }}
run: |
sudo apt-get update
sudo apt-get install -y \
libpulse0 \
libglu1-mesa \
libnss3 \
libxss1

echo "✅ Linux dependencies installed successfully"
shell: bash

- name: Install Android SDK packages
if: ${{ inputs.platform == 'android' }}
run: |
echo "Accepting SDK licenses..."
printf 'y\n%.0s' {1..10} | "${ANDROID_HOME}/cmdline-tools/latest/bin/sdkmanager" --licenses

echo "Installing Android SDK components..."
"${ANDROID_HOME}/cmdline-tools/latest/bin/sdkmanager" --install \
"platform-tools" \
"platforms;android-${{ inputs.android-api-level }}" \
"build-tools;34.0.0" \
"emulator" \
"system-images;android-${{ inputs.android-api-level }};google_apis;${{ inputs.android-abi }}" \

echo "Updating SDK packages..."
"${ANDROID_HOME}/cmdline-tools/latest/bin/sdkmanager" --update

echo "✅ Android SDK packages installed successfully"
shell: bash

## NDK Setup

- name: Debug Android SDK Paths
if: ${{ inputs.platform == 'android' }}
run: |
echo "ANDROID_HOME: $ANDROID_HOME"
echo "ANDROID_SDK_ROOT: $ANDROID_SDK_ROOT"
shell: bash

- name: Install Android NDK
if: ${{ inputs.platform == 'android' }}
run: |
"$ANDROID_HOME/cmdline-tools/latest/bin/sdkmanager" "ndk;${{ inputs.ndk-version }}"
shell: bash

- name: Add Android tools to PATH
if: ${{ inputs.platform == 'android' }}
run: |
echo "$ANDROID_HOME/platform-tools" >> "$GITHUB_PATH"
echo "$ANDROID_HOME/emulator" >> "$GITHUB_PATH"
echo "$ANDROID_HOME/cmdline-tools/latest/bin" >> "$GITHUB_PATH"
shell: bash

- name: Add NDK related toolchains to PATH
if: ${{ inputs.platform == 'android' }}
run: |
NDK_TOOLCHAIN="$ANDROID_SDK_ROOT/ndk/${{ inputs.ndk-version }}/toolchains/llvm/prebuilt/linux-x86_64/bin"
echo "$NDK_TOOLCHAIN" >> "$GITHUB_PATH"
echo "$ANDROID_SDK_ROOT/ndk/${{ inputs.ndk-version }}" >> "$GITHUB_PATH"
shell: bash

## Launch AVD

- name: Set ANDROID_AVD_HOME for downstream steps
if: ${{ inputs.platform == 'android'}}
shell: bash
run: |
echo "ANDROID_AVD_HOME=$HOME/.android/avd" >> "$GITHUB_ENV"
mkdir -p "$HOME/.android/avd"

- name: Create Android Virtual Device (AVD)
if: ${{ inputs.platform == 'android'}}
run: |
IMAGE="system-images;android-${{ inputs.android-api-level }};google_apis;${{ inputs.android-abi }}"
echo "Creating AVD with image: $IMAGE"
echo "no" | "${ANDROID_HOME}/cmdline-tools/latest/bin/avdmanager" create avd \
--name "${{ inputs.android-avd-name }}" \
--package "$IMAGE" \
--device "${{ inputs.android-device }}"
shell: bash