From a75fa8b07dfe23177335ebdaf9d90075d26a468b Mon Sep 17 00:00:00 2001 From: Jake Perkins Date: Wed, 9 Jul 2025 15:35:25 -0500 Subject: [PATCH 01/95] e2e-env-action --- .github/actions/setup-e2e-env/action.yml | 108 +++++++++++++++++++++++ 1 file changed, 108 insertions(+) create mode 100644 .github/actions/setup-e2e-env/action.yml diff --git a/.github/actions/setup-e2e-env/action.yml b/.github/actions/setup-e2e-env/action.yml new file mode 100644 index 00000000..ada83594 --- /dev/null +++ b/.github/actions/setup-e2e-env/action.yml @@ -0,0 +1,108 @@ +name: 'Setup E2E Test Environment' +description: 'Sets up the environment for running E2E tests' +inputs: + platform: + description: 'Platform (ios or android)' + required: true + node-version: + description: 'Node.js version' + required: false + default: '20.18.0' + setup-simulator: + description: 'Whether to setup simulator/emulator' + required: false + default: 'false' + # See https://github.com/actions/runner-images/blob/main/images/macos/macos-14-Readme.md#installed-simulators + ios-simulator-device: + description: Name of iOS simulator device to boot (e.g., "iPhone 15") + required: false + default: "iPhone 15" + 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.0) + required: false + default: "15.0" + + +runs: + using: "composite" + steps: + +## Common Setup ## + - run: echo "Setup E2E Environment started" + shell: bash + + - name: Install Yarn + run: corepack enable && corepack prepare yarn@stable --activate + shell: bash + + - name: Install Detox CLI + run: yarn global add detox-cli + shell: bash + + - name: Install Foundry + run: curl -L https://foundry.paradigm.xyz | bash && ~/.foundry/bin/foundryup + shell: bash + +## IOS Setup ## + - name: Setup Ruby + if: ${{ inputs.platform == 'ios' }} + uses: ruby/setup-ruby@v1 + with: + ruby-version: ${{ inputs.ruby-version }} + + - name: Select Xcode version + if: ${{ inputs.platform == 'ios' }} + run: sudo xcode-select -s /Applications/Xcode_${{ inputs.xcode-version }}.app + shell: bash + + - name: Install CocoaPods + if: ${{ inputs.platform == 'ios' }} + run: sudo gem install cocoapods + shell: bash + + - name: Install applesimutils + if: ${{ inputs.platform == 'ios' }} + run: brew tap wix/brew && brew install applesimutils + shell: bash + + - name: Boot iOS Simulator (if not already booted) + if: ${{ inputs.platform == 'ios' && inputs.setup-simulator == 'true' }} + run: | + echo "Looking for simulator named: ${{ inputs.ios-simulator-device }}" + + SIMULATOR_LINE=$(xcrun simctl list devices | grep -m1 "${{ inputs.ios-simulator-device }}") + if [ -z "$SIMULATOR_LINE" ]; then + echo "No simulator found with name '${{ inputs.ios-simulator-device }}'" + exit 1 + fi + + SIMULATOR_ID=$(echo "$SIMULATOR_LINE" | awk -F '[()]' '{print $2}') + SIMULATOR_STATE=$(echo "$SIMULATOR_LINE" | awk -F '[()]' '{print $NF}') + + echo "Simulator ID: $SIMULATOR_ID" + echo "Simulator State: $SIMULATOR_STATE" + + if [ "$SIMULATOR_STATE" = "Booted" ]; then + echo "Simulator is already booted. Skipping boot step." + else + echo "Booting simulator..." + xcrun simctl boot "$SIMULATOR_ID" + fi + shell: bash + + + + + + + + + From ab67becfb6159db204cb73d4647ca291c597137d Mon Sep 17 00:00:00 2001 From: Jake Perkins Date: Wed, 9 Jul 2025 16:07:53 -0500 Subject: [PATCH 02/95] add more deps --- .github/actions/setup-e2e-env/action.yml | 22 +++++++++++++++++++--- 1 file changed, 19 insertions(+), 3 deletions(-) diff --git a/.github/actions/setup-e2e-env/action.yml b/.github/actions/setup-e2e-env/action.yml index ada83594..5a1f7a2b 100644 --- a/.github/actions/setup-e2e-env/action.yml +++ b/.github/actions/setup-e2e-env/action.yml @@ -17,6 +17,10 @@ inputs: description: Name of iOS simulator device to boot (e.g., "iPhone 15") required: false default: "iPhone 15" + bundler-version: + description: 'Bundler version to use (only for iOS)' + required: false + default: '2.5.8' cache-prefix: description: 'Cache key prefix' required: false @@ -54,18 +58,30 @@ runs: ## IOS Setup ## - name: Setup Ruby if: ${{ inputs.platform == 'ios' }} - uses: ruby/setup-ruby@v1 + uses: ruby/setup-ruby@e851ebd3adcc861aa9e9763c26a9025811f77cd9 # ( v1.245.0 ) with: ruby-version: ${{ inputs.ruby-version }} + - name: Install bundler + if: ${{ inputs.platform == 'ios' }} + run: gem install bundler -v ${{ inputs.bundler-version }} + shell: bash + - name: Select Xcode version if: ${{ inputs.platform == 'ios' }} run: sudo xcode-select -s /Applications/Xcode_${{ inputs.xcode-version }}.app shell: bash - - name: Install CocoaPods + - name: Install Ruby gems via bundler if: ${{ inputs.platform == 'ios' }} - run: sudo gem install cocoapods + run: bundle install + working-directory: ios + shell: bash + + - name: Install CocoaPods via bundler + if: ${{ inputs.platform == 'ios' && inputs.setup-simulator == 'true' }} + run: bundle exec pod install + working-directory: ios shell: bash - name: Install applesimutils From 22a7b88557bef52b446f28c48d450e026a30b49b Mon Sep 17 00:00:00 2001 From: Jake Perkins Date: Wed, 9 Jul 2025 16:17:34 -0500 Subject: [PATCH 03/95] fix cursor bug --- .github/actions/setup-e2e-env/action.yml | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/.github/actions/setup-e2e-env/action.yml b/.github/actions/setup-e2e-env/action.yml index 5a1f7a2b..82ec8dd2 100644 --- a/.github/actions/setup-e2e-env/action.yml +++ b/.github/actions/setup-e2e-env/action.yml @@ -92,16 +92,16 @@ runs: - name: Boot iOS Simulator (if not already booted) if: ${{ inputs.platform == 'ios' && inputs.setup-simulator == 'true' }} run: | - echo "Looking for simulator named: ${{ inputs.ios-simulator-device }}" + echo "Looking for simulator named: ${{ inputs.ios-device }}" - SIMULATOR_LINE=$(xcrun simctl list devices | grep -m1 "${{ inputs.ios-simulator-device }}") + SIMULATOR_LINE=$(xcrun simctl list devices | grep -m1 "${{ inputs.ios-device }}") if [ -z "$SIMULATOR_LINE" ]; then - echo "No simulator found with name '${{ inputs.ios-simulator-device }}'" + echo "No simulator found with name '${{ inputs.ios-device }}'" exit 1 fi SIMULATOR_ID=$(echo "$SIMULATOR_LINE" | awk -F '[()]' '{print $2}') - SIMULATOR_STATE=$(echo "$SIMULATOR_LINE" | awk -F '[()]' '{print $NF}') + SIMULATOR_STATE=$(echo "$SIMULATOR_LINE" | awk -F '[()]' '{print $(NF-1)}') echo "Simulator ID: $SIMULATOR_ID" echo "Simulator State: $SIMULATOR_STATE" @@ -117,6 +117,7 @@ runs: + From 610d928d5d9430ae38720c05f8079f7c12e89d5e Mon Sep 17 00:00:00 2001 From: Jake Perkins Date: Thu, 10 Jul 2025 09:47:56 -0500 Subject: [PATCH 04/95] new action shas --- .github/actions/setup-e2e-env/action.yml | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/.github/actions/setup-e2e-env/action.yml b/.github/actions/setup-e2e-env/action.yml index 82ec8dd2..6e49ba71 100644 --- a/.github/actions/setup-e2e-env/action.yml +++ b/.github/actions/setup-e2e-env/action.yml @@ -58,7 +58,7 @@ runs: ## IOS Setup ## - name: Setup Ruby if: ${{ inputs.platform == 'ios' }} - uses: ruby/setup-ruby@e851ebd3adcc861aa9e9763c26a9025811f77cd9 # ( v1.245.0 ) + uses: ruby/setup-ruby@a4effe49ee8ee5b8b5091268c473a4628afb5651 with: ruby-version: ${{ inputs.ruby-version }} @@ -114,6 +114,11 @@ runs: fi shell: bash +## Android Setup + - name: Setup Java + if: ${{ inputs.platform == 'android' }} + uses: actions/setup-java@c5195efecf7bdfc987ee8bae7a71cb8b11521c00 + From 6ebb0f3ecfb6ad5486b8d20982088f7b1231ee01 Mon Sep 17 00:00:00 2001 From: Jake Perkins Date: Thu, 10 Jul 2025 10:16:18 -0500 Subject: [PATCH 05/95] yarn install --- .github/actions/setup-e2e-env/action.yml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/.github/actions/setup-e2e-env/action.yml b/.github/actions/setup-e2e-env/action.yml index 6e49ba71..98445e72 100644 --- a/.github/actions/setup-e2e-env/action.yml +++ b/.github/actions/setup-e2e-env/action.yml @@ -62,6 +62,11 @@ runs: with: ruby-version: ${{ inputs.ruby-version }} + - name: Install JavaScript dependencies + if: ${{ inputs.platform == 'ios' }} + run: yarn install --frozen-lockfile + shell: bash + - name: Install bundler if: ${{ inputs.platform == 'ios' }} run: gem install bundler -v ${{ inputs.bundler-version }} From f6e583de84731fd259a2641cd13a0935bd54f9b8 Mon Sep 17 00:00:00 2001 From: Jake Perkins Date: Thu, 10 Jul 2025 17:52:31 -0500 Subject: [PATCH 06/95] yarn cache --- .github/actions/setup-e2e-env/action.yml | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/.github/actions/setup-e2e-env/action.yml b/.github/actions/setup-e2e-env/action.yml index 98445e72..bad52702 100644 --- a/.github/actions/setup-e2e-env/action.yml +++ b/.github/actions/setup-e2e-env/action.yml @@ -43,10 +43,28 @@ runs: - run: echo "Setup E2E Environment started" shell: bash +## Yarn Setup & Cache Management + - name: Install Yarn run: corepack enable && corepack prepare yarn@stable --activate shell: bash + - name: Restore Yarn cache + uses: actions/cache@8d5c5ea20e39b25cfe73e20a7e3cc8232c7a80e8 + with: + path: | + **/node_modules + key: ${{ inputs.cache-prefix }}-yarn-${{ inputs.platform }}-${{ runner.os }}-${{ hashFiles('**/yarn.lock') }} + restore-keys: | + ${{ inputs.cache-prefix }}-yarn-${{ inputs.platform }}-${{ runner.os }}- + + # Step 3: Install JS deps (fast if node_modules is cached) + - name: Install JavaScript dependencies + if: ${{ inputs.platform == 'ios' }} + run: yarn install --frozen-lockfile + shell: bash + + - name: Install Detox CLI run: yarn global add detox-cli shell: bash From e4322a44ca0694b24fe0f77141867ca1a77444ba Mon Sep 17 00:00:00 2001 From: Jake Perkins Date: Thu, 10 Jul 2025 17:59:36 -0500 Subject: [PATCH 07/95] cache act --- .github/actions/setup-e2e-env/action.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/actions/setup-e2e-env/action.yml b/.github/actions/setup-e2e-env/action.yml index bad52702..5b222cd8 100644 --- a/.github/actions/setup-e2e-env/action.yml +++ b/.github/actions/setup-e2e-env/action.yml @@ -50,7 +50,7 @@ runs: shell: bash - name: Restore Yarn cache - uses: actions/cache@8d5c5ea20e39b25cfe73e20a7e3cc8232c7a80e8 + uses: actions/cache@v4 with: path: | **/node_modules From 4a813306947ff1181bf014d6de7fd1101c9eac98 Mon Sep 17 00:00:00 2001 From: Jake Perkins Date: Thu, 10 Jul 2025 18:08:29 -0500 Subject: [PATCH 08/95] fix sim device --- .github/actions/setup-e2e-env/action.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/actions/setup-e2e-env/action.yml b/.github/actions/setup-e2e-env/action.yml index 5b222cd8..81b969d5 100644 --- a/.github/actions/setup-e2e-env/action.yml +++ b/.github/actions/setup-e2e-env/action.yml @@ -115,11 +115,11 @@ runs: - name: Boot iOS Simulator (if not already booted) if: ${{ inputs.platform == 'ios' && inputs.setup-simulator == 'true' }} run: | - echo "Looking for simulator named: ${{ inputs.ios-device }}" + echo "Looking for simulator named: ${{ inputs.ios-simulator-device }}" - SIMULATOR_LINE=$(xcrun simctl list devices | grep -m1 "${{ inputs.ios-device }}") + SIMULATOR_LINE=$(xcrun simctl list devices | grep -m1 "${{ inputs.ios-simulator-device }}") if [ -z "$SIMULATOR_LINE" ]; then - echo "No simulator found with name '${{ inputs.ios-device }}'" + echo "No simulator found with name '${{ inputs.ios-simulator-device }}'" exit 1 fi From bc2f52fdd495127caf7ffbe5a68936cf3e54ca49 Mon Sep 17 00:00:00 2001 From: Jake Perkins Date: Thu, 10 Jul 2025 18:58:05 -0500 Subject: [PATCH 09/95] bundler-cache --- .github/actions/setup-e2e-env/action.yml | 38 ++++++++++++++++-------- 1 file changed, 25 insertions(+), 13 deletions(-) diff --git a/.github/actions/setup-e2e-env/action.yml b/.github/actions/setup-e2e-env/action.yml index 81b969d5..59acff55 100644 --- a/.github/actions/setup-e2e-env/action.yml +++ b/.github/actions/setup-e2e-env/action.yml @@ -8,6 +8,10 @@ inputs: description: 'Node.js version' required: false default: '20.18.0' + yarn-version: + description: Yarn version to use with Corepack + required: false + default: '1.22.22' setup-simulator: description: 'Whether to setup simulator/emulator' required: false @@ -46,25 +50,24 @@ runs: ## Yarn Setup & Cache Management - name: Install Yarn - run: corepack enable && corepack prepare yarn@stable --activate + run: corepack enable && corepack prepare yarn@${{ inputs.yarn-version }} --activate shell: bash + - name: Restore Yarn cache uses: actions/cache@v4 with: path: | - **/node_modules + node_modules key: ${{ inputs.cache-prefix }}-yarn-${{ inputs.platform }}-${{ runner.os }}-${{ hashFiles('**/yarn.lock') }} restore-keys: | ${{ inputs.cache-prefix }}-yarn-${{ inputs.platform }}-${{ runner.os }}- - # Step 3: Install JS deps (fast if node_modules is cached) - name: Install JavaScript dependencies if: ${{ inputs.platform == 'ios' }} run: yarn install --frozen-lockfile shell: bash - - name: Install Detox CLI run: yarn global add detox-cli shell: bash @@ -74,33 +77,42 @@ runs: shell: bash ## IOS Setup ## + +## Ruby Setup & Cache Management - name: Setup Ruby if: ${{ inputs.platform == 'ios' }} uses: ruby/setup-ruby@a4effe49ee8ee5b8b5091268c473a4628afb5651 with: ruby-version: ${{ inputs.ruby-version }} - - name: Install JavaScript dependencies - if: ${{ inputs.platform == 'ios' }} - run: yarn install --frozen-lockfile - shell: bash - + # Install Bundler first - name: Install bundler if: ${{ inputs.platform == 'ios' }} run: gem install bundler -v ${{ inputs.bundler-version }} shell: bash - - name: Select Xcode version + # Restore cached Ruby gems + - name: Restore Bundler cache if: ${{ inputs.platform == 'ios' }} - run: sudo xcode-select -s /Applications/Xcode_${{ inputs.xcode-version }}.app - shell: bash + 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 }}- + # Install Ruby gems into ios/vendor/bundle ( cache management & awareness ) - name: Install Ruby gems via bundler if: ${{ inputs.platform == 'ios' }} - run: bundle install + run: bundle install --path=vendor/bundle working-directory: ios shell: bash + - name: Select Xcode version + if: ${{ inputs.platform == 'ios' }} + run: sudo xcode-select -s /Applications/Xcode_${{ inputs.xcode-version }}.app + shell: bash + - name: Install CocoaPods via bundler if: ${{ inputs.platform == 'ios' && inputs.setup-simulator == 'true' }} run: bundle exec pod install From 27eed964de1fd8c92ec390ebefc066dcaba023a8 Mon Sep 17 00:00:00 2001 From: Jake Perkins Date: Thu, 10 Jul 2025 19:19:30 -0500 Subject: [PATCH 10/95] try yarn.lock perf fix --- .github/actions/setup-e2e-env/action.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/actions/setup-e2e-env/action.yml b/.github/actions/setup-e2e-env/action.yml index 59acff55..2ce06385 100644 --- a/.github/actions/setup-e2e-env/action.yml +++ b/.github/actions/setup-e2e-env/action.yml @@ -59,7 +59,7 @@ runs: with: path: | node_modules - key: ${{ inputs.cache-prefix }}-yarn-${{ inputs.platform }}-${{ runner.os }}-${{ hashFiles('**/yarn.lock') }} + key: ${{ inputs.cache-prefix }}-yarn-${{ inputs.platform }}-${{ runner.os }}-${{ hashFiles('yarn.lock') }} restore-keys: | ${{ inputs.cache-prefix }}-yarn-${{ inputs.platform }}-${{ runner.os }}- From c9e4d1eb0e1a630593019770b7a44b25c2d4894e Mon Sep 17 00:00:00 2001 From: Jake Perkins Date: Thu, 10 Jul 2025 19:37:01 -0500 Subject: [PATCH 11/95] cocoapods caching --- .github/actions/setup-e2e-env/action.yml | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/.github/actions/setup-e2e-env/action.yml b/.github/actions/setup-e2e-env/action.yml index 2ce06385..8ac54c84 100644 --- a/.github/actions/setup-e2e-env/action.yml +++ b/.github/actions/setup-e2e-env/action.yml @@ -101,10 +101,17 @@ runs: 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 --path=vendor/bundle + run: bundle install working-directory: ios shell: bash @@ -113,6 +120,16 @@ runs: run: sudo xcode-select -s /Applications/Xcode_${{ inputs.xcode-version }}.app shell: bash + - name: Restore CocoaPods cache + if: ${{ inputs.platform == 'ios' && inputs.setup-simulator == 'true' }} + 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 }}- + + - name: Install CocoaPods via bundler if: ${{ inputs.platform == 'ios' && inputs.setup-simulator == 'true' }} run: bundle exec pod install From f5c4f53ed10a375ab8e1334d51315bacfeb3c722 Mon Sep 17 00:00:00 2001 From: Jake Perkins Date: Thu, 10 Jul 2025 20:13:06 -0500 Subject: [PATCH 12/95] android tuning --- .github/actions/setup-e2e-env/action.yml | 36 ++++++++++++++++++++++++ 1 file changed, 36 insertions(+) diff --git a/.github/actions/setup-e2e-env/action.yml b/.github/actions/setup-e2e-env/action.yml index 8ac54c84..1e97f0d4 100644 --- a/.github/actions/setup-e2e-env/action.yml +++ b/.github/actions/setup-e2e-env/action.yml @@ -37,6 +37,18 @@ inputs: description: Xcode version to select (e.g., 16.0) required: false default: "15.0" + 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" runs: @@ -167,9 +179,33 @@ runs: 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 }} + +## Android SDK Setup + - name: Install Android SDK packages + if: ${{ inputs.platform == 'android' }} + run: | + yes | "${ANDROID_HOME}/cmdline-tools/latest/bin/sdkmanager" --licenses + + sdkmanager --install \ + "platform-tools" \ + "platforms;android-34" \ + "build-tools;34.0.0" \ + "emulator" \ + "system-images;android-34;google_apis;x86_64" + + sdkmanager --update + shell: bash + + + From 860c7d4ab2d3fee6422d4c4b840cd221c7f780c5 Mon Sep 17 00:00:00 2001 From: Jake Perkins Date: Thu, 10 Jul 2025 20:24:41 -0500 Subject: [PATCH 13/95] tuning --- .github/actions/setup-e2e-env/action.yml | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/.github/actions/setup-e2e-env/action.yml b/.github/actions/setup-e2e-env/action.yml index 1e97f0d4..3fa4d7b5 100644 --- a/.github/actions/setup-e2e-env/action.yml +++ b/.github/actions/setup-e2e-env/action.yml @@ -204,6 +204,19 @@ runs: sdkmanager --update shell: bash + ## NDK Setup + - name: Install Android NDK + if: ${{ inputs.platform == 'android' }} + run: sdkmanager "ndk;${{ inputs.ndk-version }}" + shell: bash + + - name: Set ANDROID_NDK_HOME + if: ${{ inputs.platform == 'android' }} + run: echo "ANDROID_NDK_HOME=$ANDROID_SDK_ROOT/ndk/${{ inputs.ndk-version }}" >> $GITHUB_ENV + shell: bash + + + From 4898cab6e0390b39dc1a1483eb27674153b4b30c Mon Sep 17 00:00:00 2001 From: Jake Perkins Date: Thu, 10 Jul 2025 20:29:59 -0500 Subject: [PATCH 14/95] license-accepts --- .github/actions/setup-e2e-env/action.yml | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/.github/actions/setup-e2e-env/action.yml b/.github/actions/setup-e2e-env/action.yml index 3fa4d7b5..ebf1f267 100644 --- a/.github/actions/setup-e2e-env/action.yml +++ b/.github/actions/setup-e2e-env/action.yml @@ -192,18 +192,22 @@ runs: - name: Install Android SDK packages if: ${{ inputs.platform == 'android' }} run: | - yes | "${ANDROID_HOME}/cmdline-tools/latest/bin/sdkmanager" --licenses + echo "Accepting SDK licenses..." + printf 'y\n%.0s' {1..10} | "${ANDROID_HOME}/cmdline-tools/latest/bin/sdkmanager" --licenses - sdkmanager --install \ + echo "Installing Android SDK components..." + "${ANDROID_HOME}/cmdline-tools/latest/bin/sdkmanager" --install \ "platform-tools" \ "platforms;android-34" \ "build-tools;34.0.0" \ "emulator" \ "system-images;android-34;google_apis;x86_64" - sdkmanager --update + echo "Updating SDK packages..." + "${ANDROID_HOME}/cmdline-tools/latest/bin/sdkmanager" --update shell: bash + ## NDK Setup - name: Install Android NDK if: ${{ inputs.platform == 'android' }} From 8b76ea875ce616c4d5d09e81cac421d090e1e201 Mon Sep 17 00:00:00 2001 From: Jake Perkins Date: Thu, 10 Jul 2025 20:38:14 -0500 Subject: [PATCH 15/95] foundry agnostic --- .github/actions/setup-e2e-env/action.yml | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/.github/actions/setup-e2e-env/action.yml b/.github/actions/setup-e2e-env/action.yml index ebf1f267..28b3ec17 100644 --- a/.github/actions/setup-e2e-env/action.yml +++ b/.github/actions/setup-e2e-env/action.yml @@ -85,8 +85,12 @@ runs: shell: bash - name: Install Foundry - run: curl -L https://foundry.paradigm.xyz | bash && ~/.foundry/bin/foundryup shell: bash + run: | + mkdir -p ~/.foundry + curl -L https://foundry.paradigm.xyz | bash + ~/.foundry/bin/foundryup --quiet + ## IOS Setup ## From f1008f72d4e3a0c550024c2f732faaf2b6ec8c8d Mon Sep 17 00:00:00 2001 From: Jake Perkins Date: Thu, 10 Jul 2025 20:42:25 -0500 Subject: [PATCH 16/95] setup --- .github/actions/setup-e2e-env/action.yml | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/.github/actions/setup-e2e-env/action.yml b/.github/actions/setup-e2e-env/action.yml index 28b3ec17..76eeb6e2 100644 --- a/.github/actions/setup-e2e-env/action.yml +++ b/.github/actions/setup-e2e-env/action.yml @@ -61,7 +61,8 @@ runs: ## Yarn Setup & Cache Management - - name: Install Yarn + - name: Corepack + id: corepack run: corepack enable && corepack prepare yarn@${{ inputs.yarn-version }} --activate shell: bash @@ -76,17 +77,21 @@ runs: ${{ inputs.cache-prefix }}-yarn-${{ inputs.platform }}-${{ runner.os }}- - name: Install JavaScript dependencies + id: yarn-install if: ${{ inputs.platform == 'ios' }} run: yarn install --frozen-lockfile shell: bash - name: Install Detox CLI + id: install-detox-cli run: yarn global add detox-cli shell: bash - name: Install Foundry + id: install-foundry shell: bash run: | + echo "Installing Foundry..." mkdir -p ~/.foundry curl -L https://foundry.paradigm.xyz | bash ~/.foundry/bin/foundryup --quiet From 9884d8a0a0655c88b7101c0dcd9c6e92021250b9 Mon Sep 17 00:00:00 2001 From: Jake Perkins Date: Thu, 10 Jul 2025 20:42:59 -0500 Subject: [PATCH 17/95] foundry ubuntu-mac-agnostic --- .github/actions/setup-e2e-env/action.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/actions/setup-e2e-env/action.yml b/.github/actions/setup-e2e-env/action.yml index 76eeb6e2..45a40141 100644 --- a/.github/actions/setup-e2e-env/action.yml +++ b/.github/actions/setup-e2e-env/action.yml @@ -94,7 +94,7 @@ runs: echo "Installing Foundry..." mkdir -p ~/.foundry curl -L https://foundry.paradigm.xyz | bash - ~/.foundry/bin/foundryup --quiet + ~/.foundry/bin/foundryup ## IOS Setup ## From 682cafb34f6e6c4b6944bdc62767abddc44c5666 Mon Sep 17 00:00:00 2001 From: Jake Perkins Date: Thu, 10 Jul 2025 20:47:36 -0500 Subject: [PATCH 18/95] act --- .github/actions/setup-e2e-env/action.yml | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/.github/actions/setup-e2e-env/action.yml b/.github/actions/setup-e2e-env/action.yml index 45a40141..291ba320 100644 --- a/.github/actions/setup-e2e-env/action.yml +++ b/.github/actions/setup-e2e-env/action.yml @@ -88,13 +88,14 @@ runs: shell: bash - name: Install Foundry - id: install-foundry shell: bash run: | echo "Installing Foundry..." - mkdir -p ~/.foundry - curl -L https://foundry.paradigm.xyz | bash - ~/.foundry/bin/foundryup + mkdir -p ~/.foundry/bin + curl -sL https://foundry.paradigm.xyz/foundryup -o ~/.foundry/bin/foundryup + chmod +x ~/.foundry/bin/foundryup + ~/.foundry/bin/foundryup --quiet + ## IOS Setup ## From 6a1ff9081d6c0d87c219a77491f5fb9ce510a17b Mon Sep 17 00:00:00 2001 From: Jake Perkins Date: Thu, 10 Jul 2025 21:04:10 -0500 Subject: [PATCH 19/95] foundry --- .github/actions/setup-e2e-env/action.yml | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/.github/actions/setup-e2e-env/action.yml b/.github/actions/setup-e2e-env/action.yml index 291ba320..2fd90762 100644 --- a/.github/actions/setup-e2e-env/action.yml +++ b/.github/actions/setup-e2e-env/action.yml @@ -49,6 +49,11 @@ inputs: 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" + runs: @@ -90,11 +95,15 @@ runs: - name: Install Foundry shell: bash run: | - echo "Installing Foundry..." + echo "Installing Foundry version: ${{ inputs.foundry-version }}" + mkdir -p ~/.foundry/bin - curl -sL https://foundry.paradigm.xyz/foundryup -o ~/.foundry/bin/foundryup + + curl -sL "https://github.com/foundry-rs/foundry/releases/download/${{ inputs.foundry-version }}/foundryup" -o ~/.foundry/bin/foundryup chmod +x ~/.foundry/bin/foundryup - ~/.foundry/bin/foundryup --quiet + ~/.foundry/bin/foundryup --version ${{ inputs.foundry-version }} + echo "$HOME/.foundry/bin" >> $GITHUB_PATH + From 38bd065904851bcc93440b89f84424ecbe08ec8f Mon Sep 17 00:00:00 2001 From: Jake Perkins Date: Thu, 10 Jul 2025 21:14:58 -0500 Subject: [PATCH 20/95] foundry android --- .github/actions/setup-e2e-env/action.yml | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/.github/actions/setup-e2e-env/action.yml b/.github/actions/setup-e2e-env/action.yml index 2fd90762..2bc15cfc 100644 --- a/.github/actions/setup-e2e-env/action.yml +++ b/.github/actions/setup-e2e-env/action.yml @@ -93,19 +93,15 @@ runs: shell: bash - name: Install Foundry + id: install-foundry shell: bash run: | echo "Installing Foundry version: ${{ inputs.foundry-version }}" - mkdir -p ~/.foundry/bin - - curl -sL "https://github.com/foundry-rs/foundry/releases/download/${{ inputs.foundry-version }}/foundryup" -o ~/.foundry/bin/foundryup + curl -sL "https://raw.githubusercontent.com/foundry-rs/foundry/${{ inputs.foundry-version }}/foundryup/install" | bash chmod +x ~/.foundry/bin/foundryup - ~/.foundry/bin/foundryup --version ${{ inputs.foundry-version }} - echo "$HOME/.foundry/bin" >> $GITHUB_PATH - - - + foundryup --version ${{ inputs.foundry-version }} + echo "$HOME/.foundry/bin" >> "$GITHUB_PATH" ## IOS Setup ## From 2f5e2a6bee7abb30e9260ad69d2f86e4148c75ff Mon Sep 17 00:00:00 2001 From: Jake Perkins Date: Thu, 10 Jul 2025 21:17:12 -0500 Subject: [PATCH 21/95] remover chmod --- .github/actions/setup-e2e-env/action.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/actions/setup-e2e-env/action.yml b/.github/actions/setup-e2e-env/action.yml index 2bc15cfc..3082d055 100644 --- a/.github/actions/setup-e2e-env/action.yml +++ b/.github/actions/setup-e2e-env/action.yml @@ -99,7 +99,6 @@ runs: echo "Installing Foundry version: ${{ inputs.foundry-version }}" mkdir -p ~/.foundry/bin curl -sL "https://raw.githubusercontent.com/foundry-rs/foundry/${{ inputs.foundry-version }}/foundryup/install" | bash - chmod +x ~/.foundry/bin/foundryup foundryup --version ${{ inputs.foundry-version }} echo "$HOME/.foundry/bin" >> "$GITHUB_PATH" From a3ea5d4e557612a022702b37f377460799493ef2 Mon Sep 17 00:00:00 2001 From: Jake Perkins Date: Thu, 10 Jul 2025 21:20:02 -0500 Subject: [PATCH 22/95] act --- .github/actions/setup-e2e-env/action.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/actions/setup-e2e-env/action.yml b/.github/actions/setup-e2e-env/action.yml index 3082d055..03bd4731 100644 --- a/.github/actions/setup-e2e-env/action.yml +++ b/.github/actions/setup-e2e-env/action.yml @@ -99,7 +99,7 @@ runs: echo "Installing Foundry version: ${{ inputs.foundry-version }}" mkdir -p ~/.foundry/bin curl -sL "https://raw.githubusercontent.com/foundry-rs/foundry/${{ inputs.foundry-version }}/foundryup/install" | bash - foundryup --version ${{ inputs.foundry-version }} + ~/.foundry/foundryup --version ${{ inputs.foundry-version }} echo "$HOME/.foundry/bin" >> "$GITHUB_PATH" ## IOS Setup ## From 8f3fdcbfd0e1dc5361cb7db40e74a191e676430f Mon Sep 17 00:00:00 2001 From: Jake Perkins Date: Thu, 10 Jul 2025 21:21:36 -0500 Subject: [PATCH 23/95] act --- .github/actions/setup-e2e-env/action.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/actions/setup-e2e-env/action.yml b/.github/actions/setup-e2e-env/action.yml index 03bd4731..de23ff60 100644 --- a/.github/actions/setup-e2e-env/action.yml +++ b/.github/actions/setup-e2e-env/action.yml @@ -96,9 +96,10 @@ runs: id: install-foundry shell: bash run: | - echo "Installing Foundry version: ${{ inputs.foundry-version }}" + echo "Downloading Foundry version: ${{ inputs.foundry-version }}" mkdir -p ~/.foundry/bin curl -sL "https://raw.githubusercontent.com/foundry-rs/foundry/${{ inputs.foundry-version }}/foundryup/install" | bash + echo "Running Foundryup to install version: ${{ inputs.foundry-version }}" ~/.foundry/foundryup --version ${{ inputs.foundry-version }} echo "$HOME/.foundry/bin" >> "$GITHUB_PATH" From c7d998722198af7fb61a983e039069b34ae43736 Mon Sep 17 00:00:00 2001 From: Jake Perkins Date: Thu, 10 Jul 2025 21:23:25 -0500 Subject: [PATCH 24/95] act --- .github/actions/setup-e2e-env/action.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/actions/setup-e2e-env/action.yml b/.github/actions/setup-e2e-env/action.yml index de23ff60..8b4ff152 100644 --- a/.github/actions/setup-e2e-env/action.yml +++ b/.github/actions/setup-e2e-env/action.yml @@ -100,7 +100,8 @@ runs: mkdir -p ~/.foundry/bin curl -sL "https://raw.githubusercontent.com/foundry-rs/foundry/${{ inputs.foundry-version }}/foundryup/install" | bash echo "Running Foundryup to install version: ${{ inputs.foundry-version }}" - ~/.foundry/foundryup --version ${{ inputs.foundry-version }} + ls ~/.foundry/bin + ~/.foundry/bin/foundryup --version ${{ inputs.foundry-version }} echo "$HOME/.foundry/bin" >> "$GITHUB_PATH" ## IOS Setup ## From 90d1bd2385bf4686df1c6572b4fb2c443cfc10d9 Mon Sep 17 00:00:00 2001 From: Jake Perkins Date: Thu, 10 Jul 2025 21:51:19 -0500 Subject: [PATCH 25/95] foundry --- .github/actions/setup-e2e-env/action.yml | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/.github/actions/setup-e2e-env/action.yml b/.github/actions/setup-e2e-env/action.yml index 8b4ff152..bc3d82ef 100644 --- a/.github/actions/setup-e2e-env/action.yml +++ b/.github/actions/setup-e2e-env/action.yml @@ -93,16 +93,14 @@ runs: shell: bash - name: Install Foundry - id: install-foundry shell: bash + id: install-foundry run: | - echo "Downloading Foundry version: ${{ inputs.foundry-version }}" - mkdir -p ~/.foundry/bin - curl -sL "https://raw.githubusercontent.com/foundry-rs/foundry/${{ inputs.foundry-version }}/foundryup/install" | bash - echo "Running Foundryup to install version: ${{ inputs.foundry-version }}" - ls ~/.foundry/bin - ~/.foundry/bin/foundryup --version ${{ inputs.foundry-version }} + echo "Installing Foundry via foundryup..." + curl -L https://foundry.paradigm.xyz | bash echo "$HOME/.foundry/bin" >> "$GITHUB_PATH" + ~/.foundry/bin/foundryup + ## IOS Setup ## From bfd20d8fabe155b989ae570fab2e7d9561d4a482 Mon Sep 17 00:00:00 2001 From: Jake Perkins Date: Thu, 10 Jul 2025 21:53:21 -0500 Subject: [PATCH 26/95] act --- .github/actions/setup-e2e-env/action.yml | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/.github/actions/setup-e2e-env/action.yml b/.github/actions/setup-e2e-env/action.yml index bc3d82ef..e45b0944 100644 --- a/.github/actions/setup-e2e-env/action.yml +++ b/.github/actions/setup-e2e-env/action.yml @@ -94,14 +94,16 @@ runs: - name: Install Foundry shell: bash - id: install-foundry run: | echo "Installing Foundry via foundryup..." - curl -L https://foundry.paradigm.xyz | bash + 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 "$HOME/.foundry/bin" >> "$GITHUB_PATH" ~/.foundry/bin/foundryup + ## IOS Setup ## ## Ruby Setup & Cache Management From 6d49bac79bf8c9045f7198490401cfb30d7b713f Mon Sep 17 00:00:00 2001 From: Jake Perkins Date: Thu, 10 Jul 2025 21:56:05 -0500 Subject: [PATCH 27/95] cfgs --- .github/actions/setup-e2e-env/action.yml | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) diff --git a/.github/actions/setup-e2e-env/action.yml b/.github/actions/setup-e2e-env/action.yml index e45b0944..32143333 100644 --- a/.github/actions/setup-e2e-env/action.yml +++ b/.github/actions/setup-e2e-env/action.yml @@ -96,11 +96,19 @@ runs: shell: bash run: | echo "Installing Foundry via foundryup..." - 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 "$HOME/.foundry/bin" >> "$GITHUB_PATH" - ~/.foundry/bin/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" + From b2e0ef39049eabbb7da1db55a6471f8729aa01cb Mon Sep 17 00:00:00 2001 From: Jake Perkins Date: Thu, 10 Jul 2025 22:05:12 -0500 Subject: [PATCH 28/95] ndk setup --- .github/actions/setup-e2e-env/action.yml | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/.github/actions/setup-e2e-env/action.yml b/.github/actions/setup-e2e-env/action.yml index 32143333..8e835aa3 100644 --- a/.github/actions/setup-e2e-env/action.yml +++ b/.github/actions/setup-e2e-env/action.yml @@ -233,11 +233,20 @@ runs: ## NDK Setup + + - name: Ensure sdkmanager is available + run: | + yes | "${ANDROID_SDK_ROOT}/cmdline-tools/11.0/bin/sdkmanager" --licenses + shell: bash + + - name: Install Android NDK if: ${{ inputs.platform == 'android' }} - run: sdkmanager "ndk;${{ inputs.ndk-version }}" + run: | + "${ANDROID_SDK_ROOT}/cmdline-tools/latest/bin/sdkmanager" "ndk;${{ inputs.ndk-version }}" shell: bash + - name: Set ANDROID_NDK_HOME if: ${{ inputs.platform == 'android' }} run: echo "ANDROID_NDK_HOME=$ANDROID_SDK_ROOT/ndk/${{ inputs.ndk-version }}" >> $GITHUB_ENV From c35dbc6d431a589d3fe76debe2bdad973b2c249b Mon Sep 17 00:00:00 2001 From: Jake Perkins Date: Thu, 10 Jul 2025 22:10:51 -0500 Subject: [PATCH 29/95] ndk --- .github/actions/setup-e2e-env/action.yml | 29 ++++++++++++++++++------ 1 file changed, 22 insertions(+), 7 deletions(-) diff --git a/.github/actions/setup-e2e-env/action.yml b/.github/actions/setup-e2e-env/action.yml index 8e835aa3..5b75074c 100644 --- a/.github/actions/setup-e2e-env/action.yml +++ b/.github/actions/setup-e2e-env/action.yml @@ -234,22 +234,36 @@ runs: ## NDK Setup - - name: Ensure sdkmanager is available + - name: Debug Android SDK Paths + if: ${{ inputs.platform == 'android' }} run: | - yes | "${ANDROID_SDK_ROOT}/cmdline-tools/11.0/bin/sdkmanager" --licenses + echo "ANDROID_HOME: $ANDROID_HOME" + echo "ANDROID_SDK_ROOT: $ANDROID_SDK_ROOT" + echo "Available sdkmanager paths:" + find "$ANDROID_HOME" -type f -name sdkmanager || true shell: bash - - - name: Install Android NDK + - name: Accept Android SDK Licenses if: ${{ inputs.platform == 'android' }} run: | - "${ANDROID_SDK_ROOT}/cmdline-tools/latest/bin/sdkmanager" "ndk;${{ inputs.ndk-version }}" + yes | "$ANDROID_HOME/cmdline-tools/latest/bin/sdkmanager" --licenses shell: bash + - name: Install Android SDK Packages + if: ${{ inputs.platform == 'android' }} + run: | + "$ANDROID_HOME/cmdline-tools/latest/bin/sdkmanager" --install \ + "platform-tools" \ + "platforms;android-34" \ + "build-tools;34.0.0" \ + "emulator" \ + "system-images;android-34;google_apis;x86_64" + shell: bash - - name: Set ANDROID_NDK_HOME + - name: Install Android NDK if: ${{ inputs.platform == 'android' }} - run: echo "ANDROID_NDK_HOME=$ANDROID_SDK_ROOT/ndk/${{ inputs.ndk-version }}" >> $GITHUB_ENV + run: | + "$ANDROID_HOME/cmdline-tools/latest/bin/sdkmanager" "ndk;${{ inputs.ndk-version }}" shell: bash @@ -261,6 +275,7 @@ runs: + From 9e75e069a72f7577eeda9f3fef0b6c7b8cbf4b41 Mon Sep 17 00:00:00 2001 From: Jake Perkins Date: Thu, 10 Jul 2025 22:13:35 -0500 Subject: [PATCH 30/95] ndk --- .github/actions/setup-e2e-env/action.yml | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/.github/actions/setup-e2e-env/action.yml b/.github/actions/setup-e2e-env/action.yml index 5b75074c..8d002605 100644 --- a/.github/actions/setup-e2e-env/action.yml +++ b/.github/actions/setup-e2e-env/action.yml @@ -239,10 +239,15 @@ runs: run: | echo "ANDROID_HOME: $ANDROID_HOME" echo "ANDROID_SDK_ROOT: $ANDROID_SDK_ROOT" - echo "Available sdkmanager paths:" - find "$ANDROID_HOME" -type f -name sdkmanager || true + + echo "Searching for sdkmanager under cmdline-tools..." + find "$ANDROID_HOME/cmdline-tools" -type f -name sdkmanager || echo "sdkmanager not found" + + echo "Listing directories under cmdline-tools for visibility:" + ls -R "$ANDROID_HOME/cmdline-tools" || echo "cmdline-tools directory missing" shell: bash + - name: Accept Android SDK Licenses if: ${{ inputs.platform == 'android' }} run: | From dda3178cdda79292980fcb9482a21add9150db2d Mon Sep 17 00:00:00 2001 From: Jake Perkins Date: Thu, 10 Jul 2025 22:16:39 -0500 Subject: [PATCH 31/95] act --- .github/actions/setup-e2e-env/action.yml | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/.github/actions/setup-e2e-env/action.yml b/.github/actions/setup-e2e-env/action.yml index 8d002605..8bc3c4c2 100644 --- a/.github/actions/setup-e2e-env/action.yml +++ b/.github/actions/setup-e2e-env/action.yml @@ -248,12 +248,14 @@ runs: shell: bash - - name: Accept Android SDK Licenses + - name: Accept Android SDK licenses if: ${{ inputs.platform == 'android' }} run: | - yes | "$ANDROID_HOME/cmdline-tools/latest/bin/sdkmanager" --licenses + echo "Accepting Android SDK licenses..." + printf 'y\n%.0s' {1..20} | "$ANDROID_HOME/cmdline-tools/latest/bin/sdkmanager" --licenses shell: bash + - name: Install Android SDK Packages if: ${{ inputs.platform == 'android' }} run: | From 03cd24bd547349017f8c52e57066a6541e4fd963 Mon Sep 17 00:00:00 2001 From: Jake Perkins Date: Thu, 10 Jul 2025 22:23:01 -0500 Subject: [PATCH 32/95] licenses --- .github/actions/setup-e2e-env/action.yml | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/.github/actions/setup-e2e-env/action.yml b/.github/actions/setup-e2e-env/action.yml index 8bc3c4c2..7cd24dfe 100644 --- a/.github/actions/setup-e2e-env/action.yml +++ b/.github/actions/setup-e2e-env/action.yml @@ -239,12 +239,6 @@ runs: run: | echo "ANDROID_HOME: $ANDROID_HOME" echo "ANDROID_SDK_ROOT: $ANDROID_SDK_ROOT" - - echo "Searching for sdkmanager under cmdline-tools..." - find "$ANDROID_HOME/cmdline-tools" -type f -name sdkmanager || echo "sdkmanager not found" - - echo "Listing directories under cmdline-tools for visibility:" - ls -R "$ANDROID_HOME/cmdline-tools" || echo "cmdline-tools directory missing" shell: bash @@ -252,10 +246,11 @@ runs: if: ${{ inputs.platform == 'android' }} run: | echo "Accepting Android SDK licenses..." - printf 'y\n%.0s' {1..20} | "$ANDROID_HOME/cmdline-tools/latest/bin/sdkmanager" --licenses + bash -c 'yes | "${ANDROID_HOME}/cmdline-tools/latest/bin/sdkmanager" --licenses' || true shell: bash + - name: Install Android SDK Packages if: ${{ inputs.platform == 'android' }} run: | From 4b4e46f9a2f03cc9fbddd5c81e3d7f16e20852dd Mon Sep 17 00:00:00 2001 From: Jake Perkins Date: Thu, 10 Jul 2025 22:27:31 -0500 Subject: [PATCH 33/95] android tools --- .github/actions/setup-e2e-env/action.yml | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/.github/actions/setup-e2e-env/action.yml b/.github/actions/setup-e2e-env/action.yml index 7cd24dfe..aaabaff6 100644 --- a/.github/actions/setup-e2e-env/action.yml +++ b/.github/actions/setup-e2e-env/action.yml @@ -250,7 +250,6 @@ runs: shell: bash - - name: Install Android SDK Packages if: ${{ inputs.platform == 'android' }} run: | @@ -268,6 +267,15 @@ runs: "$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 + + From 02ff9a92b1b3367f704c6a96c8752be0b8e18abd Mon Sep 17 00:00:00 2001 From: Jake Perkins Date: Thu, 10 Jul 2025 22:32:10 -0500 Subject: [PATCH 34/95] e2e --- .github/actions/setup-e2e-env/action.yml | 29 +++++++++++------------- 1 file changed, 13 insertions(+), 16 deletions(-) diff --git a/.github/actions/setup-e2e-env/action.yml b/.github/actions/setup-e2e-env/action.yml index aaabaff6..7b6af29d 100644 --- a/.github/actions/setup-e2e-env/action.yml +++ b/.github/actions/setup-e2e-env/action.yml @@ -213,6 +213,14 @@ runs: distribution: ${{ inputs.jdk-distribution }} ## Android SDK Setup + + - name: Install required emulator dependencies + if: ${{ inputs.platform == 'android' }} + run: | + sudo apt-get update + sudo apt-get install -y libpulse0 libglu1-mesa + shell: bash + - name: Install Android SDK packages if: ${{ inputs.platform == 'android' }} run: | @@ -275,19 +283,8 @@ runs: echo "$ANDROID_HOME/cmdline-tools/latest/bin" >> "$GITHUB_PATH" shell: bash - - - - - - - - - - - - - - - - + - name: Check Installed NDK Versions + run: | + echo "Installed NDKs:" + ls -la "$ANDROID_SDK_ROOT/ndk" || echo "No NDK installed" + shell: bash From 5695370448cf0490b14ad0aced71da33f5082d65 Mon Sep 17 00:00:00 2001 From: Jake Perkins Date: Thu, 10 Jul 2025 22:39:52 -0500 Subject: [PATCH 35/95] act --- .github/actions/setup-e2e-env/action.yml | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/.github/actions/setup-e2e-env/action.yml b/.github/actions/setup-e2e-env/action.yml index 7b6af29d..a3375836 100644 --- a/.github/actions/setup-e2e-env/action.yml +++ b/.github/actions/setup-e2e-env/action.yml @@ -283,6 +283,13 @@ runs: echo "$ANDROID_HOME/cmdline-tools/latest/bin" >> "$GITHUB_PATH" shell: bash + - name: Add NDK toolchain 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" + shell : bash + - name: Check Installed NDK Versions run: | echo "Installed NDKs:" From f399c35ba12447b233733e651b7559ba035de4dc Mon Sep 17 00:00:00 2001 From: Jake Perkins Date: Thu, 10 Jul 2025 22:47:20 -0500 Subject: [PATCH 36/95] act --- .github/actions/setup-e2e-env/action.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/actions/setup-e2e-env/action.yml b/.github/actions/setup-e2e-env/action.yml index a3375836..7be5f9e1 100644 --- a/.github/actions/setup-e2e-env/action.yml +++ b/.github/actions/setup-e2e-env/action.yml @@ -283,11 +283,12 @@ runs: echo "$ANDROID_HOME/cmdline-tools/latest/bin" >> "$GITHUB_PATH" shell: bash - - name: Add NDK toolchain to PATH + - 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 - name: Check Installed NDK Versions From 4d875528b92c6b9099789395976e60d8e57ddac5 Mon Sep 17 00:00:00 2001 From: Jake Perkins Date: Thu, 10 Jul 2025 23:00:50 -0500 Subject: [PATCH 37/95] upgrade default xcode-version --- .github/actions/setup-e2e-env/action.yml | 19 ++++++++----------- 1 file changed, 8 insertions(+), 11 deletions(-) diff --git a/.github/actions/setup-e2e-env/action.yml b/.github/actions/setup-e2e-env/action.yml index 7be5f9e1..19259f0e 100644 --- a/.github/actions/setup-e2e-env/action.yml +++ b/.github/actions/setup-e2e-env/action.yml @@ -34,9 +34,9 @@ inputs: required: false default: "3.1" xcode-version: - description: Xcode version to select (e.g., 16.0) + description: Xcode version to select (e.g., 16.2) required: false - default: "15.0" + default: "16.2" jdk-version: description: JDK version to use (only for Android) required: false @@ -151,11 +151,13 @@ runs: 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 shell: bash + # Restore CocoaPods cache - name: Restore CocoaPods cache if: ${{ inputs.platform == 'ios' && inputs.setup-simulator == 'true' }} uses: actions/cache@v4 @@ -165,7 +167,7 @@ runs: 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' && inputs.setup-simulator == 'true' }} run: bundle exec pod install @@ -202,7 +204,8 @@ runs: fi shell: bash -## Android Setup + +## Android Setup ## ## JDK Setup - name: Setup Java @@ -289,10 +292,4 @@ runs: 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 - - - name: Check Installed NDK Versions - run: | - echo "Installed NDKs:" - ls -la "$ANDROID_SDK_ROOT/ndk" || echo "No NDK installed" - shell: bash + shell : bash \ No newline at end of file From 929ddaaba614e40d28514263ae5f6d4c0f295ae1 Mon Sep 17 00:00:00 2001 From: Jake Perkins Date: Fri, 11 Jul 2025 10:23:13 -0500 Subject: [PATCH 38/95] e2e --- .github/actions/setup-e2e-env/action.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/actions/setup-e2e-env/action.yml b/.github/actions/setup-e2e-env/action.yml index 19259f0e..463173ea 100644 --- a/.github/actions/setup-e2e-env/action.yml +++ b/.github/actions/setup-e2e-env/action.yml @@ -86,6 +86,8 @@ runs: if: ${{ inputs.platform == 'ios' }} run: yarn install --frozen-lockfile shell: bash + env: + NODE_OPTIONS: --max-old-space-size=4096 # Increase memory limit for Node.js due to large dependencies - name: Install Detox CLI id: install-detox-cli From d9de05d4c20c649b2467ef2a5b43a99f0807e750 Mon Sep 17 00:00:00 2001 From: Jake Perkins Date: Fri, 11 Jul 2025 14:02:09 -0500 Subject: [PATCH 39/95] lint --- .github/actions/setup-e2e-env/action.yml | 56 ++++++++++-------------- 1 file changed, 22 insertions(+), 34 deletions(-) diff --git a/.github/actions/setup-e2e-env/action.yml b/.github/actions/setup-e2e-env/action.yml index 463173ea..22de0e84 100644 --- a/.github/actions/setup-e2e-env/action.yml +++ b/.github/actions/setup-e2e-env/action.yml @@ -17,10 +17,10 @@ inputs: required: false default: 'false' # See https://github.com/actions/runner-images/blob/main/images/macos/macos-14-Readme.md#installed-simulators - ios-simulator-device: + ios-simulator-device: description: Name of iOS simulator device to boot (e.g., "iPhone 15") required: false - default: "iPhone 15" + default: 'iPhone 15' bundler-version: description: 'Bundler version to use (only for iOS)' required: false @@ -32,46 +32,42 @@ inputs: ruby-version: description: Ruby version to use (only for iOS) required: false - default: "3.1" + default: '3.1' xcode-version: description: Xcode version to select (e.g., 16.2) required: false - default: "16.2" + default: '16.2' jdk-version: description: JDK version to use (only for Android) required: false - default: "17" + default: '17' jdk-distribution: description: JDK distribution to use (only for Android) required: false - default: "temurin" + default: 'temurin' ndk-version: description: NDK version to use (only for Android) required: false - default: "26.1.10909125" + default: '26.1.10909125' foundry-version: description: Foundry version to install required: false - default: "v1.2.3" - - + default: 'v1.2.3' runs: - using: "composite" + using: 'composite' steps: - -## Common Setup ## + ## Common Setup ## - run: echo "Setup E2E Environment started" shell: bash -## Yarn Setup & Cache Management + ## Yarn 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: @@ -83,7 +79,6 @@ runs: - name: Install JavaScript dependencies id: yarn-install - if: ${{ inputs.platform == 'ios' }} run: yarn install --frozen-lockfile shell: bash env: @@ -98,7 +93,7 @@ runs: shell: bash run: | echo "Installing Foundry via foundryup..." - + export FOUNDRY_DIR="${XDG_CONFIG_HOME:-$HOME/.config}/.foundry" export FOUNDRY_BIN="$FOUNDRY_DIR/bin" @@ -111,12 +106,9 @@ runs: "$FOUNDRY_BIN/foundryup" + ## IOS Setup ## - - -## IOS Setup ## - -## Ruby Setup & Cache Management + ## Ruby Setup & Cache Management - name: Setup Ruby if: ${{ inputs.platform == 'ios' }} uses: ruby/setup-ruby@a4effe49ee8ee5b8b5091268c473a4628afb5651 @@ -206,10 +198,9 @@ runs: fi shell: bash + ## Android Setup ## -## Android Setup ## - -## JDK Setup + ## JDK Setup - name: Setup Java if: ${{ inputs.platform == 'android' }} uses: actions/setup-java@c5195efecf7bdfc987ee8bae7a71cb8b11521c00 @@ -217,7 +208,7 @@ runs: java-version: ${{ inputs.jdk-version }} distribution: ${{ inputs.jdk-distribution }} -## Android SDK Setup + ## Android SDK Setup - name: Install required emulator dependencies if: ${{ inputs.platform == 'android' }} @@ -244,8 +235,7 @@ runs: "${ANDROID_HOME}/cmdline-tools/latest/bin/sdkmanager" --update shell: bash - - ## NDK Setup + ## NDK Setup - name: Debug Android SDK Paths if: ${{ inputs.platform == 'android' }} @@ -254,7 +244,6 @@ runs: echo "ANDROID_SDK_ROOT: $ANDROID_SDK_ROOT" shell: bash - - name: Accept Android SDK licenses if: ${{ inputs.platform == 'android' }} run: | @@ -262,7 +251,6 @@ runs: bash -c 'yes | "${ANDROID_HOME}/cmdline-tools/latest/bin/sdkmanager" --licenses' || true shell: bash - - name: Install Android SDK Packages if: ${{ inputs.platform == 'android' }} run: | @@ -291,7 +279,7 @@ runs: - 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 \ No newline at end of file + 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 From 18421e818eb3b4a94a5d12f32bfa4f8f80d1279c Mon Sep 17 00:00:00 2001 From: Jake Perkins Date: Fri, 11 Jul 2025 17:00:15 -0500 Subject: [PATCH 40/95] android-simulator --- .github/actions/setup-e2e-env/action.yml | 50 ++++++++++++++++++++---- 1 file changed, 43 insertions(+), 7 deletions(-) diff --git a/.github/actions/setup-e2e-env/action.yml b/.github/actions/setup-e2e-env/action.yml index 22de0e84..61b2f0f1 100644 --- a/.github/actions/setup-e2e-env/action.yml +++ b/.github/actions/setup-e2e-env/action.yml @@ -17,8 +17,8 @@ inputs: required: false default: 'false' # See https://github.com/actions/runner-images/blob/main/images/macos/macos-14-Readme.md#installed-simulators - ios-simulator-device: - description: Name of iOS simulator device to boot (e.g., "iPhone 15") + ios-device: + description: Name of iOS device to boot (e.g., "iPhone 15") required: false default: 'iPhone 15' bundler-version: @@ -53,6 +53,18 @@ inputs: 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' runs: using: 'composite' @@ -176,11 +188,11 @@ runs: - name: Boot iOS Simulator (if not already booted) if: ${{ inputs.platform == 'ios' && inputs.setup-simulator == 'true' }} run: | - echo "Looking for simulator named: ${{ inputs.ios-simulator-device }}" + echo "Looking for simulator named: ${{ inputs.ios-device }}" - SIMULATOR_LINE=$(xcrun simctl list devices | grep -m1 "${{ inputs.ios-simulator-device }}") + SIMULATOR_LINE=$(xcrun simctl list devices | grep -m1 "${{ inputs.ios-device }}") if [ -z "$SIMULATOR_LINE" ]; then - echo "No simulator found with name '${{ inputs.ios-simulator-device }}'" + echo "No simulator found with name '${{ inputs.ios-device }}'" exit 1 fi @@ -256,10 +268,10 @@ runs: run: | "$ANDROID_HOME/cmdline-tools/latest/bin/sdkmanager" --install \ "platform-tools" \ - "platforms;android-34" \ + "platforms;android-${{ inputs.android-api-level }}" \ "build-tools;34.0.0" \ "emulator" \ - "system-images;android-34;google_apis;x86_64" + "system-images;android-${{ inputs.android-api-level }};google_apis;x86_64" shell: bash - name: Install Android NDK @@ -283,3 +295,27 @@ runs: echo "$NDK_TOOLCHAIN" >> "$GITHUB_PATH" echo "$ANDROID_SDK_ROOT/ndk/${{ inputs.ndk-version }}" >> "$GITHUB_PATH" shell: bash + + ## Launch AVD + - name: Install Android system image + if: ${{ inputs.platform == 'android' }} ${{ inputs.setup-simulator == 'true' }} + run: | + IMAGE="system-images;android-${{ inputs.android-api-level }};google_apis;x86_64" + echo "Installing system image: $IMAGE" + "${ANDROID_HOME}/cmdline-tools/latest/bin/sdkmanager" --install "$IMAGE" + shell: bash + + - name: Create Android Virtual Device (AVD) + if: ${{ inputs.platform == 'android' }} ${{ inputs.setup-simulator == 'true' }} + run: | + IMAGE="system-images;android-${{ inputs.android-api-level }};google_apis;x86_64" + echo "no" | "${ANDROID_HOME}/cmdline-tools/latest/bin/avdmanager" create avd \ + --name ${{ inputs.android-avd-name }} \ + --package "$IMAGE" \ + --device ${ inputs.android-device } + shell: bash + + - name: Launch Android Emulator + if: ${{ inputs.platform == 'android' }} && ${{ inputs.setup-simulator == 'true' }} + run: nohup $ANDROID_HOME/emulator/emulator -avd ${{ inputs.android-avd-name }} -no-window -no-audio -no-boot-anim > /dev/null 2>&1 & + shell: bash From 93cf96ae2ba6d22eaa67286bc50b8a52eade70b5 Mon Sep 17 00:00:00 2001 From: Jake Perkins Date: Fri, 11 Jul 2025 17:05:03 -0500 Subject: [PATCH 41/95] android-act --- .github/actions/setup-e2e-env/action.yml | 26 ++++++++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/.github/actions/setup-e2e-env/action.yml b/.github/actions/setup-e2e-env/action.yml index 61b2f0f1..9c3b1791 100644 --- a/.github/actions/setup-e2e-env/action.yml +++ b/.github/actions/setup-e2e-env/action.yml @@ -297,6 +297,7 @@ runs: shell: bash ## Launch AVD + - name: Install Android system image if: ${{ inputs.platform == 'android' }} ${{ inputs.setup-simulator == 'true' }} run: | @@ -315,7 +316,32 @@ runs: --device ${ inputs.android-device } shell: bash + # Launch Android Emulator - name: Launch Android Emulator if: ${{ inputs.platform == 'android' }} && ${{ inputs.setup-simulator == 'true' }} run: nohup $ANDROID_HOME/emulator/emulator -avd ${{ inputs.android-avd-name }} -no-window -no-audio -no-boot-anim > /dev/null 2>&1 & shell: bash + + ## Wait for Emulator to Boot + - name: Wait for Android Emulator to Boot + if: ${{ inputs.platform == 'android' }} + run: | + adb wait-for-device + bootanim="" + timeout=300 # 5 minutes in seconds + elapsed=0 + + until [[ "$bootanim" == *"stopped"* || "$elapsed" -ge "$timeout" ]]; do + bootanim=$(adb shell getprop init.svc.bootanim 2>/dev/null) + echo "Waiting for emulator... ($bootanim) (${elapsed}s elapsed)" + sleep 5 + elapsed=$((elapsed + 5)) + done + + if [[ "$bootanim" != *"stopped"* ]]; then + echo "❌ Timeout waiting for emulator to boot" + exit 1 + fi + + echo "✅ Emulator booted successfully" + shell: bash From db782297505f2ceba855a3a3867b1cf642927600 Mon Sep 17 00:00:00 2001 From: Jake Perkins Date: Fri, 11 Jul 2025 17:11:52 -0500 Subject: [PATCH 42/95] fix emu bug --- .github/actions/setup-e2e-env/action.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/actions/setup-e2e-env/action.yml b/.github/actions/setup-e2e-env/action.yml index 9c3b1791..d1c77c91 100644 --- a/.github/actions/setup-e2e-env/action.yml +++ b/.github/actions/setup-e2e-env/action.yml @@ -313,7 +313,7 @@ runs: echo "no" | "${ANDROID_HOME}/cmdline-tools/latest/bin/avdmanager" create avd \ --name ${{ inputs.android-avd-name }} \ --package "$IMAGE" \ - --device ${ inputs.android-device } + --device "${{ inputs.android-device }}" shell: bash # Launch Android Emulator From 37051d08e2e1e8d3d4e9a90fb81f47276bbdf506 Mon Sep 17 00:00:00 2001 From: Jake Perkins Date: Fri, 11 Jul 2025 17:22:53 -0500 Subject: [PATCH 43/95] act --- .github/actions/setup-e2e-env/action.yml | 21 +++++++++++++-------- 1 file changed, 13 insertions(+), 8 deletions(-) diff --git a/.github/actions/setup-e2e-env/action.yml b/.github/actions/setup-e2e-env/action.yml index d1c77c91..687f01d9 100644 --- a/.github/actions/setup-e2e-env/action.yml +++ b/.github/actions/setup-e2e-env/action.yml @@ -326,22 +326,27 @@ runs: - name: Wait for Android Emulator to Boot if: ${{ inputs.platform == 'android' }} run: | + echo "Waiting for emulator to be ready..." adb wait-for-device + bootanim="" timeout=300 # 5 minutes in seconds elapsed=0 - until [[ "$bootanim" == *"stopped"* || "$elapsed" -ge "$timeout" ]]; do - bootanim=$(adb shell getprop init.svc.bootanim 2>/dev/null) + while [[ "$elapsed" -lt "$timeout" ]]; do + bootanim=$(adb shell getprop init.svc.bootanim 2>/dev/null || echo "unknown") echo "Waiting for emulator... ($bootanim) (${elapsed}s elapsed)" + + if [[ "$bootanim" == *"stopped"* ]]; then + echo "✅ Emulator booted successfully" + exit 0 + fi + sleep 5 elapsed=$((elapsed + 5)) done - if [[ "$bootanim" != *"stopped"* ]]; then - echo "❌ Timeout waiting for emulator to boot" - exit 1 - fi - - echo "✅ Emulator booted successfully" + echo "❌ Timeout waiting for emulator to boot" + exit 1 shell: bash + From dade4762c46c41351b9d271436695f984a4e888c Mon Sep 17 00:00:00 2001 From: Jake Perkins Date: Fri, 11 Jul 2025 17:35:50 -0500 Subject: [PATCH 44/95] act --- .github/actions/setup-e2e-env/action.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/actions/setup-e2e-env/action.yml b/.github/actions/setup-e2e-env/action.yml index 687f01d9..82d56642 100644 --- a/.github/actions/setup-e2e-env/action.yml +++ b/.github/actions/setup-e2e-env/action.yml @@ -319,7 +319,7 @@ runs: # Launch Android Emulator - name: Launch Android Emulator if: ${{ inputs.platform == 'android' }} && ${{ inputs.setup-simulator == 'true' }} - run: nohup $ANDROID_HOME/emulator/emulator -avd ${{ inputs.android-avd-name }} -no-window -no-audio -no-boot-anim > /dev/null 2>&1 & + run: $ANDROID_HOME/emulator/emulator -avd test_e2e_avd -no-audio -no-boot-anim -no-window -verbose shell: bash ## Wait for Emulator to Boot From 852925609a53c81893997a24cbe0a72c39371cb8 Mon Sep 17 00:00:00 2001 From: Jake Perkins Date: Fri, 11 Jul 2025 17:43:42 -0500 Subject: [PATCH 45/95] emulator bugs --- .github/actions/setup-e2e-env/action.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/actions/setup-e2e-env/action.yml b/.github/actions/setup-e2e-env/action.yml index 82d56642..66dd2da5 100644 --- a/.github/actions/setup-e2e-env/action.yml +++ b/.github/actions/setup-e2e-env/action.yml @@ -299,7 +299,7 @@ runs: ## Launch AVD - name: Install Android system image - if: ${{ inputs.platform == 'android' }} ${{ inputs.setup-simulator == 'true' }} + if: ${{ inputs.platform == 'android' && inputs.setup-simulator == 'true' }} run: | IMAGE="system-images;android-${{ inputs.android-api-level }};google_apis;x86_64" echo "Installing system image: $IMAGE" @@ -307,11 +307,11 @@ runs: shell: bash - name: Create Android Virtual Device (AVD) - if: ${{ inputs.platform == 'android' }} ${{ inputs.setup-simulator == 'true' }} + if: ${{ inputs.platform == 'android' && inputs.setup-simulator == 'true' }} run: | IMAGE="system-images;android-${{ inputs.android-api-level }};google_apis;x86_64" echo "no" | "${ANDROID_HOME}/cmdline-tools/latest/bin/avdmanager" create avd \ - --name ${{ inputs.android-avd-name }} \ + --name "${{ inputs.android-avd-name }}" \ --package "$IMAGE" \ --device "${{ inputs.android-device }}" shell: bash @@ -324,7 +324,7 @@ runs: ## Wait for Emulator to Boot - name: Wait for Android Emulator to Boot - if: ${{ inputs.platform == 'android' }} + if: ${{ inputs.platform == 'android' }} && ${{ inputs.setup-simulator == 'true' }} run: | echo "Waiting for emulator to be ready..." adb wait-for-device From 3b49d849bf1ab5cc4085807614fcf11433ec74bd Mon Sep 17 00:00:00 2001 From: Jake Perkins Date: Fri, 11 Jul 2025 18:02:32 -0500 Subject: [PATCH 46/95] android-sim --- .github/actions/setup-e2e-env/action.yml | 24 +++++++++++++++++++++--- 1 file changed, 21 insertions(+), 3 deletions(-) diff --git a/.github/actions/setup-e2e-env/action.yml b/.github/actions/setup-e2e-env/action.yml index 66dd2da5..3b137eb1 100644 --- a/.github/actions/setup-e2e-env/action.yml +++ b/.github/actions/setup-e2e-env/action.yml @@ -298,6 +298,8 @@ runs: ## Launch AVD +## Launch AVD + - name: Install Android system image if: ${{ inputs.platform == 'android' && inputs.setup-simulator == 'true' }} run: | @@ -306,25 +308,40 @@ runs: "${ANDROID_HOME}/cmdline-tools/latest/bin/sdkmanager" --install "$IMAGE" shell: bash + - name: Set ANDROID_AVD_HOME for downstream steps + if: ${{ inputs.platform == 'android' && inputs.setup-simulator == 'true' }} + 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' && inputs.setup-simulator == 'true' }} run: | IMAGE="system-images;android-${{ inputs.android-api-level }};google_apis;x86_64" + 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 + - name: List available AVDs + if: ${{ inputs.platform == 'android' && inputs.setup-simulator == 'true' }} + run: | + echo "✅ Available AVDs:" + "${ANDROID_HOME}/cmdline-tools/latest/bin/avdmanager" list avd || true + # Launch Android Emulator - name: Launch Android Emulator - if: ${{ inputs.platform == 'android' }} && ${{ inputs.setup-simulator == 'true' }} - run: $ANDROID_HOME/emulator/emulator -avd test_e2e_avd -no-audio -no-boot-anim -no-window -verbose + if: ${{ inputs.platform == 'android' && inputs.setup-simulator == 'true' }} + run: | + "$ANDROID_HOME/emulator/emulator" -avd "${{ inputs.android-avd-name }}" -no-audio -no-boot-anim -no-window -verbose shell: bash ## Wait for Emulator to Boot - name: Wait for Android Emulator to Boot - if: ${{ inputs.platform == 'android' }} && ${{ inputs.setup-simulator == 'true' }} + if: ${{ inputs.platform == 'android' && inputs.setup-simulator == 'true' }} run: | echo "Waiting for emulator to be ready..." adb wait-for-device @@ -350,3 +367,4 @@ runs: exit 1 shell: bash + From a4ca242158ee881023863c24d53298cd6853536e Mon Sep 17 00:00:00 2001 From: Jake Perkins Date: Fri, 11 Jul 2025 18:04:25 -0500 Subject: [PATCH 47/95] act --- .github/actions/setup-e2e-env/action.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/actions/setup-e2e-env/action.yml b/.github/actions/setup-e2e-env/action.yml index 3b137eb1..241c423a 100644 --- a/.github/actions/setup-e2e-env/action.yml +++ b/.github/actions/setup-e2e-env/action.yml @@ -328,6 +328,7 @@ runs: - name: List available AVDs if: ${{ inputs.platform == 'android' && inputs.setup-simulator == 'true' }} + shell: bash run: | echo "✅ Available AVDs:" "${ANDROID_HOME}/cmdline-tools/latest/bin/avdmanager" list avd || true From b1867a914271f7d3b97d95d393bb8738f569bd2d Mon Sep 17 00:00:00 2001 From: Jake Perkins Date: Fri, 11 Jul 2025 18:16:33 -0500 Subject: [PATCH 48/95] act --- .github/actions/setup-e2e-env/action.yml | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/.github/actions/setup-e2e-env/action.yml b/.github/actions/setup-e2e-env/action.yml index 241c423a..e71dc9a0 100644 --- a/.github/actions/setup-e2e-env/action.yml +++ b/.github/actions/setup-e2e-env/action.yml @@ -65,6 +65,11 @@ inputs: 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: 'arm64-v8a' + runs: using: 'composite' @@ -238,10 +243,10 @@ runs: echo "Installing Android SDK components..." "${ANDROID_HOME}/cmdline-tools/latest/bin/sdkmanager" --install \ "platform-tools" \ - "platforms;android-34" \ + "platforms;android-${{ inputs.android-api-level }}" \ "build-tools;34.0.0" \ "emulator" \ - "system-images;android-34;google_apis;x86_64" + "system-images;android-34;google_apis;${{ inputs.android-abi }}" \ echo "Updating SDK packages..." "${ANDROID_HOME}/cmdline-tools/latest/bin/sdkmanager" --update @@ -271,7 +276,7 @@ runs: "platforms;android-${{ inputs.android-api-level }}" \ "build-tools;34.0.0" \ "emulator" \ - "system-images;android-${{ inputs.android-api-level }};google_apis;x86_64" + "system-images;android-${{ inputs.android-api-level }};google_apis;${{ inputs.android-abi }}" shell: bash - name: Install Android NDK @@ -303,7 +308,7 @@ runs: - name: Install Android system image if: ${{ inputs.platform == 'android' && inputs.setup-simulator == 'true' }} run: | - IMAGE="system-images;android-${{ inputs.android-api-level }};google_apis;x86_64" + IMAGE="system-images;android-${{ inputs.android-api-level }};google_apis;${{ inputs.android-abi }}" echo "Installing system image: $IMAGE" "${ANDROID_HOME}/cmdline-tools/latest/bin/sdkmanager" --install "$IMAGE" shell: bash @@ -318,7 +323,7 @@ runs: - name: Create Android Virtual Device (AVD) if: ${{ inputs.platform == 'android' && inputs.setup-simulator == 'true' }} run: | - IMAGE="system-images;android-${{ inputs.android-api-level }};google_apis;x86_64" + 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 }}" \ From 860e85f9a4e89d4723c6e5e494f358fce112c43e Mon Sep 17 00:00:00 2001 From: Jake Perkins Date: Fri, 11 Jul 2025 18:34:19 -0500 Subject: [PATCH 49/95] env --- .github/actions/setup-e2e-env/action.yml | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/.github/actions/setup-e2e-env/action.yml b/.github/actions/setup-e2e-env/action.yml index e71dc9a0..8c040811 100644 --- a/.github/actions/setup-e2e-env/action.yml +++ b/.github/actions/setup-e2e-env/action.yml @@ -227,12 +227,12 @@ runs: ## Android SDK Setup - - name: Install required emulator dependencies - if: ${{ inputs.platform == 'android' }} - run: | - sudo apt-get update - sudo apt-get install -y libpulse0 libglu1-mesa - shell: bash + # - name: Install required emulator dependencies + # if: ${{ inputs.platform == 'android' }} + # run: | + # sudo apt-get update + # sudo apt-get install -y libpulse0 libglu1-mesa + # shell: bash - name: Install Android SDK packages if: ${{ inputs.platform == 'android' }} From 032380e447a50a81cd6cdbceba0c57eb4027dd45 Mon Sep 17 00:00:00 2001 From: Jake Perkins Date: Fri, 11 Jul 2025 18:37:02 -0500 Subject: [PATCH 50/95] update android default abi --- .github/actions/setup-e2e-env/action.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/actions/setup-e2e-env/action.yml b/.github/actions/setup-e2e-env/action.yml index 8c040811..312c75a5 100644 --- a/.github/actions/setup-e2e-env/action.yml +++ b/.github/actions/setup-e2e-env/action.yml @@ -68,7 +68,7 @@ inputs: android-abi: description: 'System architecture ABI for the Android system image (e.g. x86_64, arm64-v8a, armeabi-v7a)' required: false - default: 'arm64-v8a' + default: 'x86_64' runs: From eea10a61e6e4f6cd6c2e037a0d58f09bc1d3712c Mon Sep 17 00:00:00 2001 From: Jake Perkins Date: Fri, 11 Jul 2025 18:48:11 -0500 Subject: [PATCH 51/95] act --- .github/actions/setup-e2e-env/action.yml | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/.github/actions/setup-e2e-env/action.yml b/.github/actions/setup-e2e-env/action.yml index 312c75a5..24358f25 100644 --- a/.github/actions/setup-e2e-env/action.yml +++ b/.github/actions/setup-e2e-env/action.yml @@ -342,7 +342,12 @@ runs: - name: Launch Android Emulator if: ${{ inputs.platform == 'android' && inputs.setup-simulator == 'true' }} run: | - "$ANDROID_HOME/emulator/emulator" -avd "${{ inputs.android-avd-name }}" -no-audio -no-boot-anim -no-window -verbose + nohup "$ANDROID_HOME/emulator/emulator" \ + -avd "${{ inputs.android-avd-name }}" \ + -no-audio \ + -no-boot-anim \ + -no-window \ + -verbose > /dev/null 2>&1 & shell: bash ## Wait for Emulator to Boot From 13662757307a9b5dec0584f1fc5006291e8c90a9 Mon Sep 17 00:00:00 2001 From: Jake Perkins Date: Fri, 11 Jul 2025 19:39:11 -0500 Subject: [PATCH 52/95] linting --- .github/actions/setup-e2e-env/action.yml | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/.github/actions/setup-e2e-env/action.yml b/.github/actions/setup-e2e-env/action.yml index 24358f25..cad340cb 100644 --- a/.github/actions/setup-e2e-env/action.yml +++ b/.github/actions/setup-e2e-env/action.yml @@ -70,7 +70,6 @@ inputs: required: false default: 'x86_64' - runs: using: 'composite' steps: @@ -303,7 +302,7 @@ runs: ## Launch AVD -## Launch AVD + ## Launch AVD - name: Install Android system image if: ${{ inputs.platform == 'android' && inputs.setup-simulator == 'true' }} @@ -377,5 +376,3 @@ runs: echo "❌ Timeout waiting for emulator to boot" exit 1 shell: bash - - From 367c013c332b567159831dfb4ad69b2432fdc530 Mon Sep 17 00:00:00 2001 From: Jake Perkins Date: Tue, 15 Jul 2025 16:33:52 -0500 Subject: [PATCH 53/95] always lay out simulator cfgs --- .github/actions/setup-e2e-env/action.yml | 27 ++++++++---------------- 1 file changed, 9 insertions(+), 18 deletions(-) diff --git a/.github/actions/setup-e2e-env/action.yml b/.github/actions/setup-e2e-env/action.yml index cad340cb..2be4eef4 100644 --- a/.github/actions/setup-e2e-env/action.yml +++ b/.github/actions/setup-e2e-env/action.yml @@ -226,12 +226,12 @@ runs: ## Android SDK Setup - # - name: Install required emulator dependencies - # if: ${{ inputs.platform == 'android' }} - # run: | - # sudo apt-get update - # sudo apt-get install -y libpulse0 libglu1-mesa - # shell: bash + - 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 + shell: bash - name: Install Android SDK packages if: ${{ inputs.platform == 'android' }} @@ -302,10 +302,8 @@ runs: ## Launch AVD - ## Launch AVD - - name: Install Android system image - if: ${{ inputs.platform == 'android' && inputs.setup-simulator == 'true' }} + if: ${{ inputs.platform == 'android' }} run: | IMAGE="system-images;android-${{ inputs.android-api-level }};google_apis;${{ inputs.android-abi }}" echo "Installing system image: $IMAGE" @@ -313,14 +311,14 @@ runs: shell: bash - name: Set ANDROID_AVD_HOME for downstream steps - if: ${{ inputs.platform == 'android' && inputs.setup-simulator == 'true' }} + 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' && inputs.setup-simulator == 'true' }} + if: ${{ inputs.platform == 'android'}} run: | IMAGE="system-images;android-${{ inputs.android-api-level }};google_apis;${{ inputs.android-abi }}" echo "Creating AVD with image: $IMAGE" @@ -330,13 +328,6 @@ runs: --device "${{ inputs.android-device }}" shell: bash - - name: List available AVDs - if: ${{ inputs.platform == 'android' && inputs.setup-simulator == 'true' }} - shell: bash - run: | - echo "✅ Available AVDs:" - "${ANDROID_HOME}/cmdline-tools/latest/bin/avdmanager" list avd || true - # Launch Android Emulator - name: Launch Android Emulator if: ${{ inputs.platform == 'android' && inputs.setup-simulator == 'true' }} From d7a349b87908485cfff22c5a76d114f8af3ba88b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=C3=A3o?= Date: Wed, 16 Jul 2025 14:56:23 +0100 Subject: [PATCH 54/95] E2e ubuntu runners (#87) * feat(INFRA-2766): update for ubuntu runners * feat(INFRA-2766): remove ios references not used * feat(INFRA-2766): pwetty --- .github/actions/setup-e2e-env/action.yml | 85 ++++++++++++++---------- 1 file changed, 51 insertions(+), 34 deletions(-) diff --git a/.github/actions/setup-e2e-env/action.yml b/.github/actions/setup-e2e-env/action.yml index 2be4eef4..2a29f58f 100644 --- a/.github/actions/setup-e2e-env/action.yml +++ b/.github/actions/setup-e2e-env/action.yml @@ -230,7 +230,13 @@ runs: if: ${{ inputs.platform == 'android' && runner.os == 'Linux' }} run: | sudo apt-get update - sudo apt-get install -y libpulse0 libglu1-mesa + sudo apt-get install -y \ + libpulse0 \ + libglu1-mesa \ + libnss3 \ + libxss1 + + echo "✅ Linux dependencies installed successfully" shell: bash - name: Install Android SDK packages @@ -245,10 +251,12 @@ runs: "platforms;android-${{ inputs.android-api-level }}" \ "build-tools;34.0.0" \ "emulator" \ - "system-images;android-34;google_apis;${{ inputs.android-abi }}" \ + "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 @@ -260,24 +268,6 @@ runs: echo "ANDROID_SDK_ROOT: $ANDROID_SDK_ROOT" shell: bash - - name: Accept Android SDK licenses - if: ${{ inputs.platform == 'android' }} - run: | - echo "Accepting Android SDK licenses..." - bash -c 'yes | "${ANDROID_HOME}/cmdline-tools/latest/bin/sdkmanager" --licenses' || true - shell: bash - - - name: Install Android SDK Packages - if: ${{ inputs.platform == 'android' }} - run: | - "$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 }}" - shell: bash - - name: Install Android NDK if: ${{ inputs.platform == 'android' }} run: | @@ -302,14 +292,6 @@ runs: ## Launch AVD - - name: Install Android system image - if: ${{ inputs.platform == 'android' }} - run: | - IMAGE="system-images;android-${{ inputs.android-api-level }};google_apis;${{ inputs.android-abi }}" - echo "Installing system image: $IMAGE" - "${ANDROID_HOME}/cmdline-tools/latest/bin/sdkmanager" --install "$IMAGE" - shell: bash - - name: Set ANDROID_AVD_HOME for downstream steps if: ${{ inputs.platform == 'android'}} shell: bash @@ -332,11 +314,16 @@ runs: - name: Launch Android Emulator if: ${{ inputs.platform == 'android' && inputs.setup-simulator == 'true' }} run: | + # Linux with KVM hardware acceleration nohup "$ANDROID_HOME/emulator/emulator" \ -avd "${{ inputs.android-avd-name }}" \ -no-audio \ -no-boot-anim \ -no-window \ + -gpu swiftshader_indirect \ + -no-snapshot \ + -wipe-data \ + -accel on \ -verbose > /dev/null 2>&1 & shell: bash @@ -344,26 +331,56 @@ runs: - name: Wait for Android Emulator to Boot if: ${{ inputs.platform == 'android' && inputs.setup-simulator == 'true' }} run: | - echo "Waiting for emulator to be ready..." + echo "Waiting for emulator to be ready on $RUNNER_OS..." + + # Wait for device to be detected by ADB + echo "Waiting for ADB to detect device..." adb wait-for-device + # Additional wait for emulator to stabilize + sleep 10 + + # Check emulator status + echo "Checking emulator processes..." + if [ "$RUNNER_OS" = "Linux" ]; then + ps aux | grep emulator || echo "No emulator processes found" + fi + + # Wait for boot to complete bootanim="" - timeout=300 # 5 minutes in seconds + timeout=600 # 10 minutes for initial boot (Linux might be slower) elapsed=0 while [[ "$elapsed" -lt "$timeout" ]]; do bootanim=$(adb shell getprop init.svc.bootanim 2>/dev/null || echo "unknown") - echo "Waiting for emulator... ($bootanim) (${elapsed}s elapsed)" + sys_boot_completed=$(adb shell getprop sys.boot_completed 2>/dev/null || echo "0") + + echo "Waiting for emulator... bootanim: $bootanim, boot_completed: $sys_boot_completed (${elapsed}s elapsed)" - if [[ "$bootanim" == *"stopped"* ]]; then + if [[ "$bootanim" == *"stopped"* ]] && [[ "$sys_boot_completed" == "1" ]]; then echo "✅ Emulator booted successfully" + + # Unlock screen and disable animations for testing + adb shell input keyevent 82 # Unlock + adb shell settings put global window_animation_scale 0 + adb shell settings put global transition_animation_scale 0 + adb shell settings put global animator_duration_scale 0 + + echo "✅ Emulator is ready for testing" exit 0 fi - sleep 5 - elapsed=$((elapsed + 5)) + sleep 10 + elapsed=$((elapsed + 10)) done echo "❌ Timeout waiting for emulator to boot" + + # Debug information on failure + echo "Debug: ADB devices:" + adb devices + echo "Debug: Emulator processes:" + ps aux | grep emulator || echo "No emulator processes found" + exit 1 shell: bash From 4459e301b7c2da1223d34d9492285731bc2eb56c Mon Sep 17 00:00:00 2001 From: jake-perkins <128608287+jake-perkins@users.noreply.github.com> Date: Fri, 18 Jul 2025 01:59:02 -0500 Subject: [PATCH 55/95] E2e env actions keystore (#90) * keystore-actions * act * --repo-update on pod install * keystore * android keystore configuration * ios signing * keystores * ios-crypto --- .github/actions/configure-keystore/action.yml | 115 ++++++++++++++++++ .github/actions/setup-e2e-env/action.yml | 6 +- 2 files changed, 120 insertions(+), 1 deletion(-) create mode 100644 .github/actions/configure-keystore/action.yml diff --git a/.github/actions/configure-keystore/action.yml b/.github/actions/configure-keystore/action.yml new file mode 100644 index 00000000..d10cbc5c --- /dev/null +++ b/.github/actions/configure-keystore/action.yml @@ -0,0 +1,115 @@ +name: "Configure Keystore" +description: "Assume an AWS role and fetch a secret into environment variables" + +inputs: + aws-role-to-assume: + description: "The AWS IAM role to assume" + required: true + aws-region: + description: "The AWS region where the secret is stored" + required: true + secret-name: + description: "The name of the secret in AWS Secrets Manager" + required: true + platform: + description: "The platform for which the keystore is being configured (e.g., ios, android)" + required: true + environment: + description: "The environment for which the keystore is being configured (e.g., qa, flask, main)" + required: true + +runs: + using: "composite" + steps: + - name: Determine signing secret name + shell: bash + run: | + case "${{ inputs.environment }}" in + qa) + SECRET_NAME="metamask-mobile-qa-signing-certificates" + ;; + flask) + SECRET_NAME="metamask-mobile-flask-signing-certificates" + ;; + main) + SECRET_NAME="metamask-mobile-main-signing-certificates" + ;; + *) + echo "❌ Unknown environment: ${{ inputs.environment }}" + exit 1 + ;; + esac + echo "AWS_SIGNING_CERT_SECRET_NAME=$SECRET_NAME" >> "$GITHUB_ENV" + + - name: Configure AWS credentials + uses: aws-actions/configure-aws-credentials@v4 + with: + role-to-assume: ${{ inputs.aws-role-to-assume }} + aws-region: ${{ inputs.aws-region }} + + - name: Fetch secret and export as environment variables + shell: bash + run: | + echo "🔐 Fetching secret from Secrets Manager..." + secret_json=$(aws secretsmanager get-secret-value \ + --region "${{ inputs.aws-region }}" \ + --secret-id "${AWS_SIGNING_CERT_SECRET_NAME}" \ + --query SecretString \ + --output text) + + keys=$(echo "$secret_json" | jq -r 'keys[]') + for key in $keys; do + value=$(echo "$secret_json" | jq -r --arg k "$key" '.[$k]') + echo "::add-mask::$value" + echo "$key=$(printf '%s' "$value")" >> "$GITHUB_ENV" + echo "✅ Set secret for key: $key" + done + + - name: Configure Android Signing Certificates + if: inputs.platform == 'android' + shell: bash + run: | + echo "📦 Configuring Android keystore..." + if [[ -z "$ANDROID_KEYSTORE" ]]; then + echo "⚠️ ANDROID_KEYSTORE is not set. Skipping keystore decoding." + exit 1 + fi + + # Use provided path if set, fallback to default + KEYSTORE_PATH="${ANDROID_KEYSTORE_PATH:-/tmp/android.keystore}" + echo "$ANDROID_KEYSTORE" | base64 --decode > "$KEYSTORE_PATH" + echo "✅ Android keystore written to $KEYSTORE_PATH" + + - name: Configure iOS Signing Certificates + if: inputs.platform == 'ios' + shell: bash + run: | + echo "📦 Configuring iOS code signing..." + + # Create paths + CERT_PATH="$RUNNER_TEMP/build_certificate.p12" + PROFILE_PATH="$RUNNER_TEMP/build_pp.mobileprovision" + KEYCHAIN_PATH="$RUNNER_TEMP/app-signing.keychain-db" + CERT_PW="${IOS_SIGNING_KEYSTORE_PASSWORD}" + + # Decode base64 files + echo "$IOS_SIGNING_KEYSTORE" | base64 --decode > "$CERT_PATH" + echo "$IOS_SIGNING_PROFILE" | base64 --decode > "$PROFILE_PATH" + echo "✅ Decoded .p12 and provisioning profile" + + # Create and unlock keychain + security create-keychain -p "$CERT_PW" "$KEYCHAIN_PATH" + security set-keychain-settings -lut 21600 "$KEYCHAIN_PATH" + security unlock-keychain -p "$CERT_PW" "$KEYCHAIN_PATH" + + # Import cert + security import "$CERT_PATH" -P "$CERT_PW" -A -t cert -f pkcs12 -k "$KEYCHAIN_PATH" > /dev/null + security set-key-partition-list -S apple-tool:,apple: -k "$CERT_PW" "$KEYCHAIN_PATH" > /dev/null + security find-identity -p codesigning "$KEYCHAIN_PATH" + + + # Install provisioning profile + mkdir -p ~/Library/MobileDevice/Provisioning\ Profiles + cp "$PROFILE_PATH" ~/Library/MobileDevice/Provisioning\ Profiles/ + echo "✅ Installed provisioning profile" + diff --git a/.github/actions/setup-e2e-env/action.yml b/.github/actions/setup-e2e-env/action.yml index 2a29f58f..02c3ceb0 100644 --- a/.github/actions/setup-e2e-env/action.yml +++ b/.github/actions/setup-e2e-env/action.yml @@ -69,6 +69,10 @@ inputs: 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' runs: using: 'composite' @@ -180,7 +184,7 @@ runs: # Install CocoaPods w/ cached bundler environment - name: Install CocoaPods via bundler if: ${{ inputs.platform == 'ios' && inputs.setup-simulator == 'true' }} - run: bundle exec pod install + run: bundle exec pod install --repo-update working-directory: ios shell: bash From 4ee8ff1e8324891aaf372b6db0c8b38485c7b214 Mon Sep 17 00:00:00 2001 From: Jake Perkins Date: Fri, 18 Jul 2025 02:02:52 -0500 Subject: [PATCH 56/95] keystore-integrations --- .github/actions/configure-keystore/action.yml | 17 +++++++------- .github/actions/setup-e2e-env/action.yml | 22 +++++++++++++++++++ 2 files changed, 30 insertions(+), 9 deletions(-) diff --git a/.github/actions/configure-keystore/action.yml b/.github/actions/configure-keystore/action.yml index d10cbc5c..9a67871d 100644 --- a/.github/actions/configure-keystore/action.yml +++ b/.github/actions/configure-keystore/action.yml @@ -1,25 +1,25 @@ -name: "Configure Keystore" -description: "Assume an AWS role and fetch a secret into environment variables" +name: 'Configure Keystore' +description: 'Assume an AWS role and fetch a secret into environment variables' inputs: aws-role-to-assume: - description: "The AWS IAM role to assume" + description: 'The AWS IAM role to assume' required: true aws-region: - description: "The AWS region where the secret is stored" + description: 'The AWS region where the secret is stored' required: true secret-name: - description: "The name of the secret in AWS Secrets Manager" + description: 'The name of the secret in AWS Secrets Manager' required: true platform: - description: "The platform for which the keystore is being configured (e.g., ios, android)" + description: 'The platform for which the keystore is being configured (e.g., ios, android)' required: true environment: - description: "The environment for which the keystore is being configured (e.g., qa, flask, main)" + description: 'The environment for which the keystore is being configured (e.g., qa, flask, main)' required: true runs: - using: "composite" + using: 'composite' steps: - name: Determine signing secret name shell: bash @@ -112,4 +112,3 @@ runs: mkdir -p ~/Library/MobileDevice/Provisioning\ Profiles cp "$PROFILE_PATH" ~/Library/MobileDevice/Provisioning\ Profiles/ echo "✅ Installed provisioning profile" - diff --git a/.github/actions/setup-e2e-env/action.yml b/.github/actions/setup-e2e-env/action.yml index 02c3ceb0..0a4ca9b8 100644 --- a/.github/actions/setup-e2e-env/action.yml +++ b/.github/actions/setup-e2e-env/action.yml @@ -73,6 +73,10 @@ inputs: description: 'Whether to configure keystores for E2E tests' required: false default: 'true' + environment: + description: 'Environment for which the keystore is being configured (e.g., qa, flask, main)' + required: false + default: 'qa' runs: using: 'composite' @@ -127,6 +131,14 @@ runs: "$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: 'arn:aws:iam::722264665990:role/metamask-mobile-build-signing-certificate-manager' + aws-region: 'us-east-2' + platform: 'ios' + environment: ${{ inputs.environment }} ## Ruby Setup & Cache Management - name: Setup Ruby @@ -228,6 +240,16 @@ runs: java-version: ${{ inputs.jdk-version }} distribution: ${{ inputs.jdk-distribution }} + ## Android Certificate Setup + - 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: 'arn:aws:iam::722264665990:role/metamask-mobile-build-signing-certificate-manager' + aws-region: 'us-east-2' + platform: 'android' + environment: ${{ inputs.environment }} + ## Android SDK Setup - name: Install required emulator dependencies From 9e04ceab892376d88d48e8c67206c2a861a71f6b Mon Sep 17 00:00:00 2001 From: Jake Perkins Date: Fri, 18 Jul 2025 08:41:39 -0500 Subject: [PATCH 57/95] keystores --- .github/actions/setup-e2e-env/action.yml | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/.github/actions/setup-e2e-env/action.yml b/.github/actions/setup-e2e-env/action.yml index 0a4ca9b8..47ec1654 100644 --- a/.github/actions/setup-e2e-env/action.yml +++ b/.github/actions/setup-e2e-env/action.yml @@ -73,6 +73,10 @@ inputs: 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-signing-certificate-manager' environment: description: 'Environment for which the keystore is being configured (e.g., qa, flask, main)' required: false @@ -135,7 +139,7 @@ runs: if: ${{ inputs.platform == 'ios' && inputs.configure-keystores == 'true' }} uses: MetaMask/github-tools/.github/actions/configure-keystore@e2e-env-actions with: - aws-role-to-assume: 'arn:aws:iam::722264665990:role/metamask-mobile-build-signing-certificate-manager' + aws-role-to-assume: ${{ inputs.keystore-role-to-assume }} aws-region: 'us-east-2' platform: 'ios' environment: ${{ inputs.environment }} @@ -245,7 +249,7 @@ runs: if: ${{ inputs.platform == 'android' && inputs.configure-keystores == 'true' }} uses: MetaMask/github-tools/.github/actions/configure-keystore@e2e-env-actions with: - aws-role-to-assume: 'arn:aws:iam::722264665990:role/metamask-mobile-build-signing-certificate-manager' + #aws-role-to-assume: 'arn:aws:iam::722264665990:role/metamask-mobile-build-signing-certificate-manager' aws-region: 'us-east-2' platform: 'android' environment: ${{ inputs.environment }} From aa884d691ad2b73e53f2d955bbdcac162406f984 Mon Sep 17 00:00:00 2001 From: Jake Perkins Date: Fri, 18 Jul 2025 08:43:57 -0500 Subject: [PATCH 58/95] keystore --- .github/actions/setup-e2e-env/action.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/actions/setup-e2e-env/action.yml b/.github/actions/setup-e2e-env/action.yml index 47ec1654..d56e4a2c 100644 --- a/.github/actions/setup-e2e-env/action.yml +++ b/.github/actions/setup-e2e-env/action.yml @@ -249,7 +249,7 @@ runs: if: ${{ inputs.platform == 'android' && inputs.configure-keystores == 'true' }} uses: MetaMask/github-tools/.github/actions/configure-keystore@e2e-env-actions with: - #aws-role-to-assume: 'arn:aws:iam::722264665990:role/metamask-mobile-build-signing-certificate-manager' + aws-role-to-assume: ${{ inputs.keystore-role-to-assume }} aws-region: 'us-east-2' platform: 'android' environment: ${{ inputs.environment }} From a4d8ac30105da3f29315236fcac5cea7e18c4e1a Mon Sep 17 00:00:00 2001 From: Jake Perkins Date: Fri, 18 Jul 2025 09:53:12 -0500 Subject: [PATCH 59/95] manage node version --- .github/actions/setup-e2e-env/action.yml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/.github/actions/setup-e2e-env/action.yml b/.github/actions/setup-e2e-env/action.yml index d56e4a2c..bb71d6c1 100644 --- a/.github/actions/setup-e2e-env/action.yml +++ b/.github/actions/setup-e2e-env/action.yml @@ -89,6 +89,11 @@ runs: - run: echo "Setup E2E Environment started" shell: bash + - name: Setup Node.js + uses: actions/setup-node@v4 + with: + node-version: ${{ inputs.node-version }} + ## Yarn Setup & Cache Management - name: Corepack From a3cd1cbba80624cee0d0882f1cda0af5a76e7d6b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=C3=A3o?= Date: Fri, 18 Jul 2025 16:20:14 +0100 Subject: [PATCH 60/95] Emulator configs (#88) * feat(INFRA-2766): test simulator configs * feat(INFRA-2766): remove boot * feat(INFRA-2766): list ios emuls * feat(INFRA-2766): test * feat(INFRA-2766): remove boot stuff for commented * feat(INFRA-2766): add kvm stuff --- .github/actions/setup-e2e-env/action.yml | 117 +++-------------------- 1 file changed, 12 insertions(+), 105 deletions(-) diff --git a/.github/actions/setup-e2e-env/action.yml b/.github/actions/setup-e2e-env/action.yml index bb71d6c1..8549d29c 100644 --- a/.github/actions/setup-e2e-env/action.yml +++ b/.github/actions/setup-e2e-env/action.yml @@ -16,11 +16,6 @@ inputs: description: 'Whether to setup simulator/emulator' required: false default: 'false' - # See https://github.com/actions/runner-images/blob/main/images/macos/macos-14-Readme.md#installed-simulators - ios-device: - description: Name of iOS device to boot (e.g., "iPhone 15") - required: false - default: 'iPhone 15' bundler-version: description: 'Bundler version to use (only for iOS)' required: false @@ -214,29 +209,9 @@ runs: run: brew tap wix/brew && brew install applesimutils shell: bash - - name: Boot iOS Simulator (if not already booted) - if: ${{ inputs.platform == 'ios' && inputs.setup-simulator == 'true' }} - run: | - echo "Looking for simulator named: ${{ inputs.ios-device }}" - - SIMULATOR_LINE=$(xcrun simctl list devices | grep -m1 "${{ inputs.ios-device }}") - if [ -z "$SIMULATOR_LINE" ]; then - echo "No simulator found with name '${{ inputs.ios-device }}'" - exit 1 - fi - - SIMULATOR_ID=$(echo "$SIMULATOR_LINE" | awk -F '[()]' '{print $2}') - SIMULATOR_STATE=$(echo "$SIMULATOR_LINE" | awk -F '[()]' '{print $(NF-1)}') - - echo "Simulator ID: $SIMULATOR_ID" - echo "Simulator State: $SIMULATOR_STATE" - - if [ "$SIMULATOR_STATE" = "Booted" ]; then - echo "Simulator is already booted. Skipping boot step." - else - echo "Booting simulator..." - xcrun simctl boot "$SIMULATOR_ID" - fi + - name: Check simutils + if: ${{ inputs.platform == 'ios' }} + run: xcrun simctl list devices shell: bash ## Android Setup ## @@ -248,8 +223,7 @@ runs: with: java-version: ${{ inputs.jdk-version }} distribution: ${{ inputs.jdk-distribution }} - - ## Android Certificate Setup + - name: Configure Android Signing Certificates if: ${{ inputs.platform == 'android' && inputs.configure-keystores == 'true' }} uses: MetaMask/github-tools/.github/actions/configure-keystore@e2e-env-actions @@ -259,6 +233,14 @@ runs: platform: 'android' environment: ${{ inputs.environment }} + - 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 @@ -344,78 +326,3 @@ runs: --package "$IMAGE" \ --device "${{ inputs.android-device }}" shell: bash - - # Launch Android Emulator - - name: Launch Android Emulator - if: ${{ inputs.platform == 'android' && inputs.setup-simulator == 'true' }} - run: | - # Linux with KVM hardware acceleration - nohup "$ANDROID_HOME/emulator/emulator" \ - -avd "${{ inputs.android-avd-name }}" \ - -no-audio \ - -no-boot-anim \ - -no-window \ - -gpu swiftshader_indirect \ - -no-snapshot \ - -wipe-data \ - -accel on \ - -verbose > /dev/null 2>&1 & - shell: bash - - ## Wait for Emulator to Boot - - name: Wait for Android Emulator to Boot - if: ${{ inputs.platform == 'android' && inputs.setup-simulator == 'true' }} - run: | - echo "Waiting for emulator to be ready on $RUNNER_OS..." - - # Wait for device to be detected by ADB - echo "Waiting for ADB to detect device..." - adb wait-for-device - - # Additional wait for emulator to stabilize - sleep 10 - - # Check emulator status - echo "Checking emulator processes..." - if [ "$RUNNER_OS" = "Linux" ]; then - ps aux | grep emulator || echo "No emulator processes found" - fi - - # Wait for boot to complete - bootanim="" - timeout=600 # 10 minutes for initial boot (Linux might be slower) - elapsed=0 - - while [[ "$elapsed" -lt "$timeout" ]]; do - bootanim=$(adb shell getprop init.svc.bootanim 2>/dev/null || echo "unknown") - sys_boot_completed=$(adb shell getprop sys.boot_completed 2>/dev/null || echo "0") - - echo "Waiting for emulator... bootanim: $bootanim, boot_completed: $sys_boot_completed (${elapsed}s elapsed)" - - if [[ "$bootanim" == *"stopped"* ]] && [[ "$sys_boot_completed" == "1" ]]; then - echo "✅ Emulator booted successfully" - - # Unlock screen and disable animations for testing - adb shell input keyevent 82 # Unlock - adb shell settings put global window_animation_scale 0 - adb shell settings put global transition_animation_scale 0 - adb shell settings put global animator_duration_scale 0 - - echo "✅ Emulator is ready for testing" - exit 0 - fi - - sleep 10 - elapsed=$((elapsed + 10)) - done - - echo "❌ Timeout waiting for emulator to boot" - - # Debug information on failure - echo "Debug: ADB devices:" - adb devices - echo "Debug: Emulator processes:" - ps aux | grep emulator || echo "No emulator processes found" - - exit 1 - shell: bash From b74890801c7688479980787bda42e82fac421772 Mon Sep 17 00:00:00 2001 From: Jake Perkins Date: Fri, 18 Jul 2025 13:13:29 -0500 Subject: [PATCH 61/95] remove cocoapods caching --- .github/actions/setup-e2e-env/action.yml | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/.github/actions/setup-e2e-env/action.yml b/.github/actions/setup-e2e-env/action.yml index 8549d29c..b9912ea1 100644 --- a/.github/actions/setup-e2e-env/action.yml +++ b/.github/actions/setup-e2e-env/action.yml @@ -188,19 +188,19 @@ runs: shell: bash # Restore CocoaPods cache - - name: Restore CocoaPods cache - if: ${{ inputs.platform == 'ios' && inputs.setup-simulator == 'true' }} - 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 }}- + # - 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' && inputs.setup-simulator == 'true' }} - run: bundle exec pod install --repo-update + if: ${{ inputs.platform == 'ios'}} + run: bundle exec pod install--repo-update --verbose working-directory: ios shell: bash From 8553525bb4c5a04948e7e0bfd8ca0ae44ee33268 Mon Sep 17 00:00:00 2001 From: Jake Perkins Date: Fri, 18 Jul 2025 13:16:28 -0500 Subject: [PATCH 62/95] fmt --- .github/actions/setup-e2e-env/action.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/actions/setup-e2e-env/action.yml b/.github/actions/setup-e2e-env/action.yml index b9912ea1..043fc766 100644 --- a/.github/actions/setup-e2e-env/action.yml +++ b/.github/actions/setup-e2e-env/action.yml @@ -200,7 +200,7 @@ runs: # Install CocoaPods w/ cached bundler environment - name: Install CocoaPods via bundler if: ${{ inputs.platform == 'ios'}} - run: bundle exec pod install--repo-update --verbose + run: bundle exec pod install --repo-update --verbose working-directory: ios shell: bash From 8f5b198cc235e9e47bf59f29eab0fb8719e0cc5c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=C3=A3o?= Date: Tue, 29 Jul 2025 12:05:51 +0100 Subject: [PATCH 63/95] self hosted --- .github/actions/setup-e2e-env/action.yml | 130 ++++++++--------------- 1 file changed, 46 insertions(+), 84 deletions(-) diff --git a/.github/actions/setup-e2e-env/action.yml b/.github/actions/setup-e2e-env/action.yml index 043fc766..fb311e3a 100644 --- a/.github/actions/setup-e2e-env/action.yml +++ b/.github/actions/setup-e2e-env/action.yml @@ -40,10 +40,6 @@ inputs: 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 @@ -84,6 +80,36 @@ runs: - run: echo "Setup E2E Environment started" shell: bash + ## Platform Environment Configuration (must happen first) ## + + # Set Android environment variables (self-hosted runner has SDK pre-installed) + - name: Set Android environment variables + if: ${{ inputs.platform == 'android' }} + run: | + echo "ANDROID_HOME=/opt/android-sdk" >> "$GITHUB_ENV" + echo "ANDROID_SDK_ROOT=/opt/android-sdk" >> "$GITHUB_ENV" + shell: bash + + - 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' + environment: ${{ inputs.environment }} + + - 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' + environment: ${{ inputs.environment }} + + ## Node.js & JavaScript Dependencies Setup ## + - name: Setup Node.js uses: actions/setup-node@v4 with: @@ -134,15 +160,7 @@ runs: "$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' - environment: ${{ inputs.environment }} + ## iOS Setup ## ## Ruby Setup & Cache Management - name: Setup Ruby @@ -216,32 +234,16 @@ runs: ## 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' - environment: ${{ inputs.environment }} - - - 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 + # KVM permissions setup - commented out for self-hosted runner + # - 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 + ## Android Emulator Setup (SDK/NDK pre-installed by self-hosted runner) - name: Install required emulator dependencies if: ${{ inputs.platform == 'android' && runner.os == 'Linux' }} @@ -256,55 +258,15 @@ runs: echo "✅ Linux dependencies installed successfully" shell: bash - - name: Install Android SDK packages + - name: Install Android emulator and system images 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" \ + echo "Installing emulator and system images..." + "/opt/android-sdk/cmdline-tools/latest/bin/sdkmanager" --install \ "emulator" \ - "system-images;android-${{ inputs.android-api-level }};google_apis;${{ inputs.android-abi }}" \ + "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" + echo "✅ Android emulator components installed successfully" shell: bash ## Launch AVD @@ -321,7 +283,7 @@ runs: 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 \ + echo "no" | "/opt/android-sdk/cmdline-tools/latest/bin/avdmanager" create avd \ --name "${{ inputs.android-avd-name }}" \ --package "$IMAGE" \ --device "${{ inputs.android-device }}" From a1f7d1866d13ab942303ca7f478f5a3fdb82795e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=C3=A3o?= Date: Tue, 29 Jul 2025 17:26:28 +0100 Subject: [PATCH 64/95] test --- .github/actions/setup-e2e-env/action.yml | 122 ++++++++++++++--------- 1 file changed, 76 insertions(+), 46 deletions(-) diff --git a/.github/actions/setup-e2e-env/action.yml b/.github/actions/setup-e2e-env/action.yml index fb311e3a..cdc22fc1 100644 --- a/.github/actions/setup-e2e-env/action.yml +++ b/.github/actions/setup-e2e-env/action.yml @@ -40,6 +40,10 @@ inputs: 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 @@ -80,36 +84,6 @@ runs: - run: echo "Setup E2E Environment started" shell: bash - ## Platform Environment Configuration (must happen first) ## - - # Set Android environment variables (self-hosted runner has SDK pre-installed) - - name: Set Android environment variables - if: ${{ inputs.platform == 'android' }} - run: | - echo "ANDROID_HOME=/opt/android-sdk" >> "$GITHUB_ENV" - echo "ANDROID_SDK_ROOT=/opt/android-sdk" >> "$GITHUB_ENV" - shell: bash - - - 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' - environment: ${{ inputs.environment }} - - - 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' - environment: ${{ inputs.environment }} - - ## Node.js & JavaScript Dependencies Setup ## - - name: Setup Node.js uses: actions/setup-node@v4 with: @@ -160,7 +134,15 @@ runs: "$FOUNDRY_BIN/foundryup" - ## iOS Setup ## + ## 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' + environment: ${{ inputs.environment }} ## Ruby Setup & Cache Management - name: Setup Ruby @@ -234,16 +216,24 @@ runs: ## Android Setup ## - # KVM permissions setup - commented out for self-hosted runner - # - 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 + ## 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' + environment: ${{ inputs.environment }} - ## Android Emulator Setup (SDK/NDK pre-installed by self-hosted runner) + ## Android SDK Setup - name: Install required emulator dependencies if: ${{ inputs.platform == 'android' && runner.os == 'Linux' }} @@ -258,15 +248,55 @@ runs: echo "✅ Linux dependencies installed successfully" shell: bash - - name: Install Android emulator and system images + - name: Install Android SDK packages if: ${{ inputs.platform == 'android' }} run: | - echo "Installing emulator and system images..." - "/opt/android-sdk/cmdline-tools/latest/bin/sdkmanager" --install \ + 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 }}" + "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 - echo "✅ Android emulator components installed successfully" + ## 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 @@ -283,7 +313,7 @@ runs: run: | IMAGE="system-images;android-${{ inputs.android-api-level }};google_apis;${{ inputs.android-abi }}" echo "Creating AVD with image: $IMAGE" - echo "no" | "/opt/android-sdk/cmdline-tools/latest/bin/avdmanager" create avd \ + echo "no" | "${ANDROID_HOME}/cmdline-tools/latest/bin/avdmanager" create avd \ --name "${{ inputs.android-avd-name }}" \ --package "$IMAGE" \ --device "${{ inputs.android-device }}" From 2ead7cbe8ef105275a86c875a7cf8be106b8d789 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=C3=A3o?= Date: Tue, 29 Jul 2025 17:31:35 +0100 Subject: [PATCH 65/95] fail fast --- .github/actions/setup-e2e-env/action.yml | 239 ++++++++++++----------- 1 file changed, 126 insertions(+), 113 deletions(-) diff --git a/.github/actions/setup-e2e-env/action.yml b/.github/actions/setup-e2e-env/action.yml index cdc22fc1..3608b20c 100644 --- a/.github/actions/setup-e2e-env/action.yml +++ b/.github/actions/setup-e2e-env/action.yml @@ -84,6 +84,132 @@ runs: - run: echo "Setup E2E Environment started" shell: bash + ## Android Setup (early for fail-fast) ## + + # Set Android environment variables (self-hosted runner has SDK pre-installed) + - name: Set Android environment variables + if: ${{ inputs.platform == 'android' }} + run: | + echo "ANDROID_HOME=/opt/android-sdk" >> "$GITHUB_ENV" + echo "ANDROID_SDK_ROOT=/opt/android-sdk" >> "$GITHUB_ENV" + shell: bash + + - 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' + environment: ${{ inputs.environment }} + + ## 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: 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 + + ## Android SDK Setup + + - name: Install Android SDK packages + if: ${{ inputs.platform == 'android' }} + run: | + echo "Accepting SDK licenses..." + printf 'y\n%.0s' {1..10} | "/opt/android-sdk/cmdline-tools/latest/bin/sdkmanager" --licenses + + echo "Installing Android SDK components..." + "/opt/android-sdk/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..." + "/opt/android-sdk/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: | + "/opt/android-sdk/cmdline-tools/latest/bin/sdkmanager" "ndk;${{ inputs.ndk-version }}" + shell: bash + + - name: Add Android tools to PATH + if: ${{ inputs.platform == 'android' }} + run: | + echo "/opt/android-sdk/platform-tools" >> "$GITHUB_PATH" + echo "/opt/android-sdk/emulator" >> "$GITHUB_PATH" + echo "/opt/android-sdk/cmdline-tools/latest/bin" >> "$GITHUB_PATH" + shell: bash + + - name: Add NDK related toolchains to PATH + if: ${{ inputs.platform == 'android' }} + run: | + NDK_TOOLCHAIN="/opt/android-sdk/ndk/${{ inputs.ndk-version }}/toolchains/llvm/prebuilt/linux-x86_64/bin" + echo "$NDK_TOOLCHAIN" >> "$GITHUB_PATH" + echo "/opt/android-sdk/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" | "/opt/android-sdk/cmdline-tools/latest/bin/avdmanager" create avd \ + --name "${{ inputs.android-avd-name }}" \ + --package "$IMAGE" \ + --device "${{ inputs.android-device }}" + shell: bash + + ## iOS Platform 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' + environment: ${{ inputs.environment }} + + ## Node.js & JavaScript Dependencies Setup ## + - name: Setup Node.js uses: actions/setup-node@v4 with: @@ -135,14 +261,6 @@ runs: "$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' - environment: ${{ inputs.environment }} ## Ruby Setup & Cache Management - name: Setup Ruby @@ -213,108 +331,3 @@ runs: 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' - environment: ${{ inputs.environment }} - - ## 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 From 5b810c9bab9ae88839e68b15fe22034330207781 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=C3=A3o?= Date: Tue, 29 Jul 2025 17:39:37 +0100 Subject: [PATCH 66/95] remove ndk because its already in the runner --- .github/actions/setup-e2e-env/action.yml | 35 ------------------------ 1 file changed, 35 deletions(-) diff --git a/.github/actions/setup-e2e-env/action.yml b/.github/actions/setup-e2e-env/action.yml index 3608b20c..ad721401 100644 --- a/.github/actions/setup-e2e-env/action.yml +++ b/.github/actions/setup-e2e-env/action.yml @@ -40,10 +40,6 @@ inputs: 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 @@ -146,37 +142,6 @@ runs: 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: | - "/opt/android-sdk/cmdline-tools/latest/bin/sdkmanager" "ndk;${{ inputs.ndk-version }}" - shell: bash - - - name: Add Android tools to PATH - if: ${{ inputs.platform == 'android' }} - run: | - echo "/opt/android-sdk/platform-tools" >> "$GITHUB_PATH" - echo "/opt/android-sdk/emulator" >> "$GITHUB_PATH" - echo "/opt/android-sdk/cmdline-tools/latest/bin" >> "$GITHUB_PATH" - shell: bash - - - name: Add NDK related toolchains to PATH - if: ${{ inputs.platform == 'android' }} - run: | - NDK_TOOLCHAIN="/opt/android-sdk/ndk/${{ inputs.ndk-version }}/toolchains/llvm/prebuilt/linux-x86_64/bin" - echo "$NDK_TOOLCHAIN" >> "$GITHUB_PATH" - echo "/opt/android-sdk/ndk/${{ inputs.ndk-version }}" >> "$GITHUB_PATH" - shell: bash - ## Launch AVD - name: Set ANDROID_AVD_HOME for downstream steps From 060107eade2b645f35f2b0292318bc3998690ace Mon Sep 17 00:00:00 2001 From: Jake Perkins Date: Mon, 4 Aug 2025 18:41:33 -0500 Subject: [PATCH 67/95] targets --- .github/actions/configure-keystore/action.yml | 8 ++++---- .github/actions/setup-e2e-env/action.yml | 8 ++++---- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/.github/actions/configure-keystore/action.yml b/.github/actions/configure-keystore/action.yml index 9a67871d..64532e53 100644 --- a/.github/actions/configure-keystore/action.yml +++ b/.github/actions/configure-keystore/action.yml @@ -14,8 +14,8 @@ inputs: platform: description: 'The platform for which the keystore is being configured (e.g., ios, android)' required: true - environment: - description: 'The environment for which the keystore is being configured (e.g., qa, flask, main)' + target: + description: 'The target for which the keystore is being configured (e.g., qa, flask, main)' required: true runs: @@ -24,7 +24,7 @@ runs: - name: Determine signing secret name shell: bash run: | - case "${{ inputs.environment }}" in + case "${{ inputs.target }}" in qa) SECRET_NAME="metamask-mobile-qa-signing-certificates" ;; @@ -35,7 +35,7 @@ runs: SECRET_NAME="metamask-mobile-main-signing-certificates" ;; *) - echo "❌ Unknown environment: ${{ inputs.environment }}" + echo "❌ Unknown target: ${{ inputs.target }}" exit 1 ;; esac diff --git a/.github/actions/setup-e2e-env/action.yml b/.github/actions/setup-e2e-env/action.yml index ad721401..699d14d1 100644 --- a/.github/actions/setup-e2e-env/action.yml +++ b/.github/actions/setup-e2e-env/action.yml @@ -68,8 +68,8 @@ inputs: description: 'AWS IAM role to assume for keystore configuration' required: false default: 'arn:aws:iam::363762752069:role/metamask-mobile-build-signing-certificate-manager' - environment: - description: 'Environment for which the keystore is being configured (e.g., qa, flask, main)' + target: + description: 'Target for which the keystore is being configured (e.g., qa, flask, main)' required: false default: 'qa' @@ -97,7 +97,7 @@ runs: aws-role-to-assume: ${{ inputs.keystore-role-to-assume }} aws-region: 'us-east-2' platform: 'android' - environment: ${{ inputs.environment }} + target: ${{ inputs.target }} ## JDK Setup - name: Setup Java @@ -171,7 +171,7 @@ runs: aws-role-to-assume: ${{ inputs.keystore-role-to-assume }} aws-region: 'us-east-2' platform: 'ios' - environment: ${{ inputs.environment }} + target: ${{ inputs.target }} ## Node.js & JavaScript Dependencies Setup ## From d378d7deb0296ae54a48887c46f41ed547c95634 Mon Sep 17 00:00:00 2001 From: Jake Perkins Date: Mon, 4 Aug 2025 19:09:09 -0500 Subject: [PATCH 68/95] fix-act --- .github/actions/setup-e2e-env/action.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/actions/setup-e2e-env/action.yml b/.github/actions/setup-e2e-env/action.yml index 699d14d1..743f306e 100644 --- a/.github/actions/setup-e2e-env/action.yml +++ b/.github/actions/setup-e2e-env/action.yml @@ -67,7 +67,7 @@ inputs: keystore-role-to-assume: description: 'AWS IAM role to assume for keystore configuration' required: false - default: 'arn:aws:iam::363762752069:role/metamask-mobile-build-signing-certificate-manager' + 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 From b3b5adf781ca781b1c490bafc35855e52ab5ae5d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=C3=A3o?= Date: Wed, 30 Jul 2025 09:00:04 +0100 Subject: [PATCH 69/95] slimmer pipeline --- .github/actions/setup-e2e-env/action.yml | 25 +++++++----------------- 1 file changed, 7 insertions(+), 18 deletions(-) diff --git a/.github/actions/setup-e2e-env/action.yml b/.github/actions/setup-e2e-env/action.yml index 743f306e..f86d636e 100644 --- a/.github/actions/setup-e2e-env/action.yml +++ b/.github/actions/setup-e2e-env/action.yml @@ -120,26 +120,15 @@ runs: echo "✅ Linux dependencies installed successfully" shell: bash - ## Android SDK Setup + ## Android SDK Setup (SDK pre-installed in container) - - name: Install Android SDK packages - if: ${{ inputs.platform == 'android' }} + - name: Install additional Android SDK components if needed + if: ${{ inputs.platform == 'android' && (inputs.android-api-level != '34' || inputs.android-abi != 'x86_64') }} run: | - echo "Accepting SDK licenses..." - printf 'y\n%.0s' {1..10} | "/opt/android-sdk/cmdline-tools/latest/bin/sdkmanager" --licenses - - echo "Installing Android SDK components..." - "/opt/android-sdk/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..." - "/opt/android-sdk/cmdline-tools/latest/bin/sdkmanager" --update - - echo "✅ Android SDK packages installed successfully" + # Only install if different from pre-installed defaults (API 34, x86_64) + IMAGE="system-images;android-${{ inputs.android-api-level }};google_apis;${{ inputs.android-abi }}" + echo "Installing additional system image: $IMAGE" + echo "y" | "/opt/android-sdk/cmdline-tools/latest/bin/sdkmanager" "$IMAGE" shell: bash ## Launch AVD From ef89e457372acb4290563671222eecfb3e5f9ae0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=C3=A3o?= Date: Thu, 7 Aug 2025 10:15:16 +0100 Subject: [PATCH 70/95] avd changes --- .github/actions/setup-e2e-env/action.yml | 22 +++++++++++++++++----- 1 file changed, 17 insertions(+), 5 deletions(-) diff --git a/.github/actions/setup-e2e-env/action.yml b/.github/actions/setup-e2e-env/action.yml index f86d636e..cb4a2e30 100644 --- a/.github/actions/setup-e2e-env/action.yml +++ b/.github/actions/setup-e2e-env/action.yml @@ -49,9 +49,9 @@ inputs: required: false default: 'test_e2e_avd' android-device: - description: 'AVD device profile (e.g. "pixel")' + description: 'AVD device profile (e.g. "pixel_5", "pixel", "Nexus 6")' required: false - default: 'pixel' + default: 'pixel_5' android-api-level: description: 'Android API level to use (e.g. "34")' required: false @@ -60,6 +60,14 @@ inputs: description: 'System architecture ABI for the Android system image (e.g. x86_64, arm64-v8a, armeabi-v7a)' required: false default: 'x86_64' + android-tag: + description: 'Android system image tag (e.g. google_apis, default)' + required: false + default: 'google_apis' + android-sdcard-size: + description: 'SD card size for AVD (e.g. 8092M)' + required: false + default: '8092M' configure-keystores: description: 'Whether to configure keystores for E2E tests' required: false @@ -143,12 +151,16 @@ runs: - name: Create Android Virtual Device (AVD) if: ${{ inputs.platform == 'android'}} run: | - IMAGE="system-images;android-${{ inputs.android-api-level }};google_apis;${{ inputs.android-abi }}" + IMAGE="system-images;android-${{ inputs.android-api-level }};${{ inputs.android-tag }};${{ inputs.android-abi }}" echo "Creating AVD with image: $IMAGE" - echo "no" | "/opt/android-sdk/cmdline-tools/latest/bin/avdmanager" create avd \ + "/opt/android-sdk/cmdline-tools/latest/bin/avdmanager" --verbose create avd \ + --force \ --name "${{ inputs.android-avd-name }}" \ --package "$IMAGE" \ - --device "${{ inputs.android-device }}" + --device "${{ inputs.android-device }}" \ + --tag "${{ inputs.android-tag }}" \ + --abi "${{ inputs.android-abi }}" \ + --sdcard "${{ inputs.android-sdcard-size }}" shell: bash ## iOS Platform Setup ## From c35da38677569ee2b896671a482563081625e300 Mon Sep 17 00:00:00 2001 From: Jake Perkins Date: Thu, 28 Aug 2025 14:20:26 -0500 Subject: [PATCH 71/95] add pod vendor to path --- .github/actions/setup-e2e-env/action.yml | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/.github/actions/setup-e2e-env/action.yml b/.github/actions/setup-e2e-env/action.yml index cb4a2e30..9a8c3c65 100644 --- a/.github/actions/setup-e2e-env/action.yml +++ b/.github/actions/setup-e2e-env/action.yml @@ -265,6 +265,17 @@ runs: working-directory: ios shell: bash + # Add vendored bundle bin to PATH so `pod` resolves correctly + - name: Add vendored bundle bin to PATH + if: ${{ inputs.platform == 'ios' }} + run: | + VENDOR_BIN="$(bundle exec ruby -e 'puts Gem.bindir')" + echo "Prepending vendored bin: $VENDOR_BIN" + echo "$VENDOR_BIN" >> "$GITHUB_PATH" + working-directory: ios + shell: bash + + # Select Xcode version - name: Select Xcode version if: ${{ inputs.platform == 'ios' }} From 5a428da4df9159c9b8434625846223de5883260e Mon Sep 17 00:00:00 2001 From: Jake Perkins Date: Thu, 28 Aug 2025 14:31:14 -0500 Subject: [PATCH 72/95] ruby/gem troubleshooting --- .github/actions/setup-e2e-env/action.yml | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/.github/actions/setup-e2e-env/action.yml b/.github/actions/setup-e2e-env/action.yml index 9a8c3c65..64273adf 100644 --- a/.github/actions/setup-e2e-env/action.yml +++ b/.github/actions/setup-e2e-env/action.yml @@ -239,6 +239,7 @@ runs: - name: Install bundler if: ${{ inputs.platform == 'ios' }} run: gem install bundler -v ${{ inputs.bundler-version }} + working-directory: ios shell: bash # Restore cached Ruby gems @@ -275,6 +276,14 @@ runs: working-directory: ios shell: bash + # Verify CocoaPods is available + - name: Verify CocoaPods + if: ${{ inputs.platform == 'ios' }} + run: | + bundle show cocoapods || (echo "❌ CocoaPods not installed from ios/Gemfile" && exit 1) + pod --version + working-directory: ios + shell: bash # Select Xcode version - name: Select Xcode version From 4364187324b67fe772ed1bc5560a2842aa883948 Mon Sep 17 00:00:00 2001 From: Jake Perkins Date: Thu, 28 Aug 2025 14:40:41 -0500 Subject: [PATCH 73/95] pod verify --- .github/actions/setup-e2e-env/action.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/actions/setup-e2e-env/action.yml b/.github/actions/setup-e2e-env/action.yml index 64273adf..71045171 100644 --- a/.github/actions/setup-e2e-env/action.yml +++ b/.github/actions/setup-e2e-env/action.yml @@ -281,7 +281,7 @@ runs: if: ${{ inputs.platform == 'ios' }} run: | bundle show cocoapods || (echo "❌ CocoaPods not installed from ios/Gemfile" && exit 1) - pod --version + bundle exec pod --version working-directory: ios shell: bash From 93a7c6ecfe9222b8f216bc9642aa8dec2d45b9ec Mon Sep 17 00:00:00 2001 From: Jake Perkins Date: Thu, 28 Aug 2025 14:50:55 -0500 Subject: [PATCH 74/95] binstub --- .github/actions/setup-e2e-env/action.yml | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/.github/actions/setup-e2e-env/action.yml b/.github/actions/setup-e2e-env/action.yml index 71045171..dbe782d3 100644 --- a/.github/actions/setup-e2e-env/action.yml +++ b/.github/actions/setup-e2e-env/action.yml @@ -266,16 +266,17 @@ runs: working-directory: ios shell: bash - # Add vendored bundle bin to PATH so `pod` resolves correctly - - name: Add vendored bundle bin to PATH + - name: Generate binstubs for CocoaPods if: ${{ inputs.platform == 'ios' }} - run: | - VENDOR_BIN="$(bundle exec ruby -e 'puts Gem.bindir')" - echo "Prepending vendored bin: $VENDOR_BIN" - echo "$VENDOR_BIN" >> "$GITHUB_PATH" + run: bundle binstubs cocoapods --path=vendor/bundle/bin working-directory: ios shell: bash + - name: Add binstubs to PATH + if: ${{ inputs.platform == 'ios' }} + run: echo "$(pwd)/ios/vendor/bundle/bin" >> "$GITHUB_PATH" + shell: bash + # Verify CocoaPods is available - name: Verify CocoaPods if: ${{ inputs.platform == 'ios' }} @@ -304,7 +305,7 @@ runs: # Install CocoaPods w/ cached bundler environment - name: Install CocoaPods via bundler if: ${{ inputs.platform == 'ios'}} - run: bundle exec pod install --repo-update --verbose + run: bundle exec pod install --repo-update working-directory: ios shell: bash From 1c024c7bf4f3c7a4fc38307059bba10b40c713f9 Mon Sep 17 00:00:00 2001 From: Jake Perkins Date: Thu, 28 Aug 2025 14:59:31 -0500 Subject: [PATCH 75/95] binstub --- .github/actions/setup-e2e-env/action.yml | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/.github/actions/setup-e2e-env/action.yml b/.github/actions/setup-e2e-env/action.yml index dbe782d3..993636d8 100644 --- a/.github/actions/setup-e2e-env/action.yml +++ b/.github/actions/setup-e2e-env/action.yml @@ -286,6 +286,15 @@ runs: working-directory: ios shell: bash + # Verify CocoaPods is available + - name: Verify CocoaPods BinStub + if: ${{ inputs.platform == 'ios' }} + run: | + bundle show cocoapods || (echo "❌ CocoaPods not installed from ios/Gemfile" && exit 1) + pod --version + working-directory: ios + shell: bash + # Select Xcode version - name: Select Xcode version if: ${{ inputs.platform == 'ios' }} @@ -317,4 +326,4 @@ runs: - name: Check simutils if: ${{ inputs.platform == 'ios' }} run: xcrun simctl list devices - shell: bash + shell: bash \ No newline at end of file From 9a1f3b3a9b9b919a1cf74e980615a3732f05e372 Mon Sep 17 00:00:00 2001 From: Jake Perkins Date: Thu, 28 Aug 2025 20:39:09 -0500 Subject: [PATCH 76/95] binstub --- .github/actions/setup-e2e-env/action.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/actions/setup-e2e-env/action.yml b/.github/actions/setup-e2e-env/action.yml index 993636d8..1c9c7c75 100644 --- a/.github/actions/setup-e2e-env/action.yml +++ b/.github/actions/setup-e2e-env/action.yml @@ -1,5 +1,6 @@ name: 'Setup E2E Test Environment' description: 'Sets up the environment for running E2E tests' + inputs: platform: description: 'Platform (ios or android)' @@ -268,7 +269,8 @@ runs: - name: Generate binstubs for CocoaPods if: ${{ inputs.platform == 'ios' }} - run: bundle binstubs cocoapods --path=vendor/bundle/bin + run: bundle binstubs cocoapods --force --path=vendor/bundle/bin + working-directory: ios shell: bash From b622c5f3e9b99277625980465346ad4ee4462621 Mon Sep 17 00:00:00 2001 From: Jake Perkins Date: Fri, 29 Aug 2025 17:27:06 -0500 Subject: [PATCH 77/95] configs --- .github/actions/configure-keystore/action.yml | 25 ++++++++++++++++--- .github/actions/setup-e2e-env/action.yml | 2 +- 2 files changed, 23 insertions(+), 4 deletions(-) diff --git a/.github/actions/configure-keystore/action.yml b/.github/actions/configure-keystore/action.yml index 64532e53..f5cf2255 100644 --- a/.github/actions/configure-keystore/action.yml +++ b/.github/actions/configure-keystore/action.yml @@ -103,10 +103,29 @@ runs: security unlock-keychain -p "$CERT_PW" "$KEYCHAIN_PATH" # Import cert - security import "$CERT_PATH" -P "$CERT_PW" -A -t cert -f pkcs12 -k "$KEYCHAIN_PATH" > /dev/null - security set-key-partition-list -S apple-tool:,apple: -k "$CERT_PW" "$KEYCHAIN_PATH" > /dev/null - security find-identity -p codesigning "$KEYCHAIN_PATH" + echo "🔐 Importing certificate..." + if ! security import "$CERT_PATH" -P "$CERT_PW" -A -t cert -f pkcs12 -k "$KEYCHAIN_PATH"; then + echo "❌ Failed to import certificate. Check if the password is correct or the .p12 is valid." + exit 1 + fi + echo "✅ Certificate imported" + # Set key partition list + echo "🔑 Setting key partition list..." + if ! security set-key-partition-list -S apple-tool:,apple: -k "$CERT_PW" "$KEYCHAIN_PATH"; then + echo "❌ Failed to set key partition list. Codesigning tools may not have access." + exit 1 + fi + echo "✅ Key partition list set" + + # Verify signing identities + echo "🔍 Verifying code signing identities in keychain..." + if ! security find-identity -p codesigning "$KEYCHAIN_PATH" | grep -q "Valid identities"; then + echo "❌ No valid code signing identities found in keychain." + security find-identity -p codesigning "$KEYCHAIN_PATH" || true + exit 1 + fi + echo "✅ Code signing identity is available" # Install provisioning profile mkdir -p ~/Library/MobileDevice/Provisioning\ Profiles diff --git a/.github/actions/setup-e2e-env/action.yml b/.github/actions/setup-e2e-env/action.yml index 1c9c7c75..1378966c 100644 --- a/.github/actions/setup-e2e-env/action.yml +++ b/.github/actions/setup-e2e-env/action.yml @@ -168,7 +168,7 @@ runs: - name: Configure iOS Signing Certificates if: ${{ inputs.platform == 'ios' && inputs.configure-keystores == 'true' }} - uses: MetaMask/github-tools/.github/actions/configure-keystore@e2e-env-actions + uses: MetaMask/github-tools/.github/actions/configure-keystore@self-hosted-runners-config with: aws-role-to-assume: ${{ inputs.keystore-role-to-assume }} aws-region: 'us-east-2' From c52672621babb1fca810c57b8ae1711897696f7a Mon Sep 17 00:00:00 2001 From: Jake Perkins Date: Fri, 29 Aug 2025 17:35:15 -0500 Subject: [PATCH 78/95] supress partition list output --- .github/actions/configure-keystore/action.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/actions/configure-keystore/action.yml b/.github/actions/configure-keystore/action.yml index f5cf2255..81f45fbf 100644 --- a/.github/actions/configure-keystore/action.yml +++ b/.github/actions/configure-keystore/action.yml @@ -112,12 +112,13 @@ runs: # Set key partition list echo "🔑 Setting key partition list..." - if ! security set-key-partition-list -S apple-tool:,apple: -k "$CERT_PW" "$KEYCHAIN_PATH"; then + if ! security set-key-partition-list -S apple-tool:,apple: -k "$CERT_PW" "$KEYCHAIN_PATH" 2>/dev/null; then echo "❌ Failed to set key partition list. Codesigning tools may not have access." exit 1 fi echo "✅ Key partition list set" + # Verify signing identities echo "🔍 Verifying code signing identities in keychain..." if ! security find-identity -p codesigning "$KEYCHAIN_PATH" | grep -q "Valid identities"; then From 344728137c9b50a94396c777874902c9de9362c8 Mon Sep 17 00:00:00 2001 From: Jake Perkins Date: Tue, 2 Sep 2025 17:14:46 -0500 Subject: [PATCH 79/95] ci --- .github/actions/configure-keystore/action.yml | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/.github/actions/configure-keystore/action.yml b/.github/actions/configure-keystore/action.yml index 81f45fbf..ef20d058 100644 --- a/.github/actions/configure-keystore/action.yml +++ b/.github/actions/configure-keystore/action.yml @@ -121,12 +121,22 @@ runs: # Verify signing identities echo "🔍 Verifying code signing identities in keychain..." - if ! security find-identity -p codesigning "$KEYCHAIN_PATH" | grep -q "Valid identities"; then + IDENTITIES=$(security find-identity -p codesigning "$KEYCHAIN_PATH") + + if ! echo "$IDENTITIES" | grep -q "Valid identities"; then echo "❌ No valid code signing identities found in keychain." - security find-identity -p codesigning "$KEYCHAIN_PATH" || true + echo "$IDENTITIES" exit 1 fi - echo "✅ Code signing identity is available" + + # Extract and print alias (first CN string) + CERT_ALIAS=$(echo "$IDENTITIES" | awk -F '"' '/"Apple/ {print $2; exit}') + if [[ -n "$CERT_ALIAS" ]]; then + echo "✅ Code signing identity available: $CERT_ALIAS" + else + echo "✅ Code signing identity is available (alias not parsed)" + fi + # Install provisioning profile mkdir -p ~/Library/MobileDevice/Provisioning\ Profiles From a345f7c0ce7e41cc6c995c6237f08b9b89593c60 Mon Sep 17 00:00:00 2001 From: Jake Perkins Date: Tue, 2 Sep 2025 17:19:52 -0500 Subject: [PATCH 80/95] debugging --- .github/actions/configure-keystore/action.yml | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/.github/actions/configure-keystore/action.yml b/.github/actions/configure-keystore/action.yml index ef20d058..d3c756df 100644 --- a/.github/actions/configure-keystore/action.yml +++ b/.github/actions/configure-keystore/action.yml @@ -137,6 +137,19 @@ runs: echo "✅ Code signing identity is available (alias not parsed)" fi + ### DEBUGGING + # Decode .mobileprovision to a readable plist + security cms -D -i "$PROFILE_PATH" > "$RUNNER_TEMP/profile.plist" + + # Show the embedded certificates (base64 DER) + plutil -extract DeveloperCertificates xml1 -o - "$RUNNER_TEMP/profile.plist" + + # Or pipe each into openssl to get subject/issuer + plutil -extract DeveloperCertificates.0 raw -o - "$RUNNER_TEMP/profile.plist" | \ + openssl x509 -inform DER -noout -subject -issuer + ### END DEBUGGING + + # Install provisioning profile mkdir -p ~/Library/MobileDevice/Provisioning\ Profiles From b532e7f7f6feb304e2102ff10987f9240cb605f8 Mon Sep 17 00:00:00 2001 From: Jake Perkins Date: Tue, 2 Sep 2025 17:25:13 -0500 Subject: [PATCH 81/95] keystore debugs --- .github/actions/configure-keystore/action.yml | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/.github/actions/configure-keystore/action.yml b/.github/actions/configure-keystore/action.yml index d3c756df..baaddfea 100644 --- a/.github/actions/configure-keystore/action.yml +++ b/.github/actions/configure-keystore/action.yml @@ -138,15 +138,17 @@ runs: fi ### DEBUGGING - # Decode .mobileprovision to a readable plist - security cms -D -i "$PROFILE_PATH" > "$RUNNER_TEMP/profile.plist" + P12_CERT_SUBJECT=$(openssl pkcs12 -in "$CERT_PATH" -nokeys -passin pass:"$CERT_PW" \ + | openssl x509 -noout -subject | sed 's/^subject= //') - # Show the embedded certificates (base64 DER) - plutil -extract DeveloperCertificates xml1 -o - "$RUNNER_TEMP/profile.plist" + echo "🔑 Imported cert subject: $P12_CERT_SUBJECT" + + if [[ "$PROFILE_CERT_SUBJECT" == "$P12_CERT_SUBJECT" ]]; then + echo "✅ Profile certificate matches imported .p12" + else + echo "❌ Mismatch: profile cert does not match imported .p12" + fi - # Or pipe each into openssl to get subject/issuer - plutil -extract DeveloperCertificates.0 raw -o - "$RUNNER_TEMP/profile.plist" | \ - openssl x509 -inform DER -noout -subject -issuer ### END DEBUGGING From 4f035642bfe1a24e95cd66e3922c66239d2a37f7 Mon Sep 17 00:00:00 2001 From: Jake Perkins Date: Tue, 2 Sep 2025 17:45:01 -0500 Subject: [PATCH 82/95] configs --- .github/actions/configure-keystore/action.yml | 26 +++++++++++++------ 1 file changed, 18 insertions(+), 8 deletions(-) diff --git a/.github/actions/configure-keystore/action.yml b/.github/actions/configure-keystore/action.yml index baaddfea..9b32c7fa 100644 --- a/.github/actions/configure-keystore/action.yml +++ b/.github/actions/configure-keystore/action.yml @@ -138,17 +138,27 @@ runs: fi ### DEBUGGING - P12_CERT_SUBJECT=$(openssl pkcs12 -in "$CERT_PATH" -nokeys -passin pass:"$CERT_PW" \ - | openssl x509 -noout -subject | sed 's/^subject= //') - - echo "🔑 Imported cert subject: $P12_CERT_SUBJECT" - - if [[ "$PROFILE_CERT_SUBJECT" == "$P12_CERT_SUBJECT" ]]; then - echo "✅ Profile certificate matches imported .p12" + # Fingerprint of cert from provisioning profile + TMP_PROFILE_PLIST="$RUNNER_TEMP/profile.plist" + security cms -D -i "$PROFILE_PATH" -o "$TMP_PROFILE_PLIST" + PROFILE_FP=$(plutil -extract DeveloperCertificates.0 raw -o - profile.plist \ + | base64 -D \ + | openssl x509 -inform DER -noout -fingerprint -sha1 | cut -d'=' -f2) + + # Fingerprint of cert from .p12 + P12_FP=$(openssl pkcs12 -in "$CERT_PATH" -nokeys -passin pass:"$CERT_PW" \ + | openssl x509 -noout -fingerprint -sha1 | cut -d'=' -f2) + + echo "Profile fingerprint: $PROFILE_FP" + echo "P12 fingerprint: $P12_FP" + + if [[ "$PROFILE_FP" == "$P12_FP" ]]; then + echo "✅ Certificates match" else - echo "❌ Mismatch: profile cert does not match imported .p12" + echo "❌ Certificates do not match" fi + ### END DEBUGGING From ed3592d01a7b41019dbc6859d82aa8839822a769 Mon Sep 17 00:00:00 2001 From: Jake Perkins Date: Tue, 2 Sep 2025 17:47:22 -0500 Subject: [PATCH 83/95] compare fingerprints --- .github/actions/configure-keystore/action.yml | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/.github/actions/configure-keystore/action.yml b/.github/actions/configure-keystore/action.yml index 9b32c7fa..18ac3d9e 100644 --- a/.github/actions/configure-keystore/action.yml +++ b/.github/actions/configure-keystore/action.yml @@ -141,7 +141,8 @@ runs: # Fingerprint of cert from provisioning profile TMP_PROFILE_PLIST="$RUNNER_TEMP/profile.plist" security cms -D -i "$PROFILE_PATH" -o "$TMP_PROFILE_PLIST" - PROFILE_FP=$(plutil -extract DeveloperCertificates.0 raw -o - profile.plist \ + + PROFILE_FP=$(plutil -extract DeveloperCertificates.0 raw -o - "$TMP_PROFILE_PLIST" \ | base64 -D \ | openssl x509 -inform DER -noout -fingerprint -sha1 | cut -d'=' -f2) @@ -149,8 +150,8 @@ runs: P12_FP=$(openssl pkcs12 -in "$CERT_PATH" -nokeys -passin pass:"$CERT_PW" \ | openssl x509 -noout -fingerprint -sha1 | cut -d'=' -f2) - echo "Profile fingerprint: $PROFILE_FP" - echo "P12 fingerprint: $P12_FP" + echo "📄 Provisioning profile fingerprint: $PROFILE_FP" + echo "🔑 Imported .p12 fingerprint: $P12_FP" if [[ "$PROFILE_FP" == "$P12_FP" ]]; then echo "✅ Certificates match" @@ -159,6 +160,7 @@ runs: fi + ### END DEBUGGING From 51c3ae973cacaf0e76f3f9208cf3db28858c289e Mon Sep 17 00:00:00 2001 From: Jake Perkins Date: Tue, 2 Sep 2025 17:59:45 -0500 Subject: [PATCH 84/95] default-chain --- .github/actions/configure-keystore/action.yml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/.github/actions/configure-keystore/action.yml b/.github/actions/configure-keystore/action.yml index 18ac3d9e..76c8faec 100644 --- a/.github/actions/configure-keystore/action.yml +++ b/.github/actions/configure-keystore/action.yml @@ -169,3 +169,8 @@ runs: mkdir -p ~/Library/MobileDevice/Provisioning\ Profiles cp "$PROFILE_PATH" ~/Library/MobileDevice/Provisioning\ Profiles/ echo "✅ Installed provisioning profile" + + echo "Configuring default keychain" + security list-keychains -d user -s "$KEYCHAIN_PATH" + security default-keychain -s "$KEYCHAIN_PATH" + From 4eec2453c5cf0b42f447e3176b1e07d11b5663b9 Mon Sep 17 00:00:00 2001 From: Jake Perkins Date: Tue, 2 Sep 2025 18:03:25 -0500 Subject: [PATCH 85/95] codesignign config --- .github/actions/configure-keystore/action.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/actions/configure-keystore/action.yml b/.github/actions/configure-keystore/action.yml index 76c8faec..4a4445e2 100644 --- a/.github/actions/configure-keystore/action.yml +++ b/.github/actions/configure-keystore/action.yml @@ -173,4 +173,5 @@ runs: echo "Configuring default keychain" security list-keychains -d user -s "$KEYCHAIN_PATH" security default-keychain -s "$KEYCHAIN_PATH" + security find-identity -p codesigning -v From e95f53dd4954a0cddfe2709249edea66f4000dfb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=C3=A3o?= Date: Wed, 3 Sep 2025 09:34:34 +0100 Subject: [PATCH 86/95] test ssl --- .github/actions/configure-keystore/action.yml | 38 +++++++++++-------- .github/actions/setup-e2e-env/action.yml | 2 +- 2 files changed, 23 insertions(+), 17 deletions(-) diff --git a/.github/actions/configure-keystore/action.yml b/.github/actions/configure-keystore/action.yml index 4a4445e2..1f6b123f 100644 --- a/.github/actions/configure-keystore/action.yml +++ b/.github/actions/configure-keystore/action.yml @@ -140,23 +140,29 @@ runs: ### DEBUGGING # Fingerprint of cert from provisioning profile TMP_PROFILE_PLIST="$RUNNER_TEMP/profile.plist" - security cms -D -i "$PROFILE_PATH" -o "$TMP_PROFILE_PLIST" - - PROFILE_FP=$(plutil -extract DeveloperCertificates.0 raw -o - "$TMP_PROFILE_PLIST" \ - | base64 -D \ - | openssl x509 -inform DER -noout -fingerprint -sha1 | cut -d'=' -f2) - - # Fingerprint of cert from .p12 - P12_FP=$(openssl pkcs12 -in "$CERT_PATH" -nokeys -passin pass:"$CERT_PW" \ - | openssl x509 -noout -fingerprint -sha1 | cut -d'=' -f2) - - echo "📄 Provisioning profile fingerprint: $PROFILE_FP" - echo "🔑 Imported .p12 fingerprint: $P12_FP" - - if [[ "$PROFILE_FP" == "$P12_FP" ]]; then - echo "✅ Certificates match" + if security cms -D -i "$PROFILE_PATH" -o "$TMP_PROFILE_PLIST" 2>/dev/null; then + PROFILE_FP=$(plutil -extract DeveloperCertificates.0 raw -o - "$TMP_PROFILE_PLIST" \ + | base64 -D \ + | openssl x509 -inform DER -noout -fingerprint -sha1 2>/dev/null | cut -d'=' -f2) + + # Fingerprint of cert from .p12 (use -legacy flag for OpenSSL 3.0 compatibility) + P12_FP=$(openssl pkcs12 -legacy -in "$CERT_PATH" -nokeys -passin pass:"$CERT_PW" 2>/dev/null \ + | openssl x509 -noout -fingerprint -sha1 2>/dev/null | cut -d'=' -f2) + + if [[ -n "$PROFILE_FP" && -n "$P12_FP" ]]; then + echo "📄 Provisioning profile fingerprint: $PROFILE_FP" + echo "🔑 Imported .p12 fingerprint: $P12_FP" + + if [[ "$PROFILE_FP" == "$P12_FP" ]]; then + echo "✅ Certificates match" + else + echo "❌ Certificates do not match" + fi + else + echo "⚠️ Could not extract certificate fingerprints for comparison" + fi else - echo "❌ Certificates do not match" + echo "⚠️ Could not decode provisioning profile for certificate verification" fi diff --git a/.github/actions/setup-e2e-env/action.yml b/.github/actions/setup-e2e-env/action.yml index 1378966c..610bbe3a 100644 --- a/.github/actions/setup-e2e-env/action.yml +++ b/.github/actions/setup-e2e-env/action.yml @@ -328,4 +328,4 @@ runs: - name: Check simutils if: ${{ inputs.platform == 'ios' }} run: xcrun simctl list devices - shell: bash \ No newline at end of file + shell: bash From 6ac80cb106bb48b4c25c331845ee179db4382bbb Mon Sep 17 00:00:00 2001 From: Jake Perkins Date: Wed, 3 Sep 2025 08:08:48 -0500 Subject: [PATCH 87/95] remove debugging --- .github/actions/configure-keystore/action.yml | 34 ------------------- 1 file changed, 34 deletions(-) diff --git a/.github/actions/configure-keystore/action.yml b/.github/actions/configure-keystore/action.yml index 1f6b123f..275e7efe 100644 --- a/.github/actions/configure-keystore/action.yml +++ b/.github/actions/configure-keystore/action.yml @@ -137,40 +137,6 @@ runs: echo "✅ Code signing identity is available (alias not parsed)" fi - ### DEBUGGING - # Fingerprint of cert from provisioning profile - TMP_PROFILE_PLIST="$RUNNER_TEMP/profile.plist" - if security cms -D -i "$PROFILE_PATH" -o "$TMP_PROFILE_PLIST" 2>/dev/null; then - PROFILE_FP=$(plutil -extract DeveloperCertificates.0 raw -o - "$TMP_PROFILE_PLIST" \ - | base64 -D \ - | openssl x509 -inform DER -noout -fingerprint -sha1 2>/dev/null | cut -d'=' -f2) - - # Fingerprint of cert from .p12 (use -legacy flag for OpenSSL 3.0 compatibility) - P12_FP=$(openssl pkcs12 -legacy -in "$CERT_PATH" -nokeys -passin pass:"$CERT_PW" 2>/dev/null \ - | openssl x509 -noout -fingerprint -sha1 2>/dev/null | cut -d'=' -f2) - - if [[ -n "$PROFILE_FP" && -n "$P12_FP" ]]; then - echo "📄 Provisioning profile fingerprint: $PROFILE_FP" - echo "🔑 Imported .p12 fingerprint: $P12_FP" - - if [[ "$PROFILE_FP" == "$P12_FP" ]]; then - echo "✅ Certificates match" - else - echo "❌ Certificates do not match" - fi - else - echo "⚠️ Could not extract certificate fingerprints for comparison" - fi - else - echo "⚠️ Could not decode provisioning profile for certificate verification" - fi - - - - ### END DEBUGGING - - - # Install provisioning profile mkdir -p ~/Library/MobileDevice/Provisioning\ Profiles cp "$PROFILE_PATH" ~/Library/MobileDevice/Provisioning\ Profiles/ From 394f14cafb5338c1d99893d0ec88fa38b40e2ec9 Mon Sep 17 00:00:00 2001 From: Jake Perkins Date: Wed, 3 Sep 2025 08:14:42 -0500 Subject: [PATCH 88/95] keychain --- .github/actions/configure-keystore/action.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/actions/configure-keystore/action.yml b/.github/actions/configure-keystore/action.yml index 275e7efe..95355933 100644 --- a/.github/actions/configure-keystore/action.yml +++ b/.github/actions/configure-keystore/action.yml @@ -143,7 +143,6 @@ runs: echo "✅ Installed provisioning profile" echo "Configuring default keychain" - security list-keychains -d user -s "$KEYCHAIN_PATH" security default-keychain -s "$KEYCHAIN_PATH" - security find-identity -p codesigning -v + echo "✅ default keychain set" From 5906de6c1235aa414488531374af005d494bf7bb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=C3=A3o?= Date: Thu, 11 Sep 2025 17:18:17 +0100 Subject: [PATCH 89/95] chore: retries (#122) --- .github/actions/setup-e2e-env/action.yml | 20 ++++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) diff --git a/.github/actions/setup-e2e-env/action.yml b/.github/actions/setup-e2e-env/action.yml index 610bbe3a..e8c7ae14 100644 --- a/.github/actions/setup-e2e-env/action.yml +++ b/.github/actions/setup-e2e-env/action.yml @@ -198,17 +198,25 @@ runs: restore-keys: | ${{ inputs.cache-prefix }}-yarn-${{ inputs.platform }}-${{ runner.os }}- - - name: Install JavaScript dependencies + - name: Install JavaScript dependencies with retry id: yarn-install - run: yarn install --frozen-lockfile - shell: bash + uses: nick-fields/retry@ce71cc2ab81d554ebbe88c79ab5975992d79ba08 #v3.0.2 + with: + timeout_minutes: 10 + max_attempts: 3 + retry_wait_seconds: 30 + command: yarn install --frozen-lockfile env: NODE_OPTIONS: --max-old-space-size=4096 # Increase memory limit for Node.js due to large dependencies - - name: Install Detox CLI + - name: Install Detox CLI with retry id: install-detox-cli - run: yarn global add detox-cli - shell: bash + uses: nick-fields/retry@ce71cc2ab81d554ebbe88c79ab5975992d79ba08 #v3.0.2 + with: + timeout_minutes: 10 + max_attempts: 3 + retry_wait_seconds: 30 + command: yarn global add detox-cli - name: Install Foundry shell: bash From fb91d2735e391bda7fbb8129054b6a724f034ad1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=C3=A3o?= Date: Thu, 11 Sep 2025 18:11:41 +0100 Subject: [PATCH 90/95] Revert "chore: retries (#122)" This reverts commit 5906de6c1235aa414488531374af005d494bf7bb. --- .github/actions/setup-e2e-env/action.yml | 20 ++++++-------------- 1 file changed, 6 insertions(+), 14 deletions(-) diff --git a/.github/actions/setup-e2e-env/action.yml b/.github/actions/setup-e2e-env/action.yml index e8c7ae14..610bbe3a 100644 --- a/.github/actions/setup-e2e-env/action.yml +++ b/.github/actions/setup-e2e-env/action.yml @@ -198,25 +198,17 @@ runs: restore-keys: | ${{ inputs.cache-prefix }}-yarn-${{ inputs.platform }}-${{ runner.os }}- - - name: Install JavaScript dependencies with retry + - name: Install JavaScript dependencies id: yarn-install - uses: nick-fields/retry@ce71cc2ab81d554ebbe88c79ab5975992d79ba08 #v3.0.2 - with: - timeout_minutes: 10 - max_attempts: 3 - retry_wait_seconds: 30 - command: yarn install --frozen-lockfile + run: yarn install --frozen-lockfile + shell: bash env: NODE_OPTIONS: --max-old-space-size=4096 # Increase memory limit for Node.js due to large dependencies - - name: Install Detox CLI with retry + - name: Install Detox CLI id: install-detox-cli - uses: nick-fields/retry@ce71cc2ab81d554ebbe88c79ab5975992d79ba08 #v3.0.2 - with: - timeout_minutes: 10 - max_attempts: 3 - retry_wait_seconds: 30 - command: yarn global add detox-cli + run: yarn global add detox-cli + shell: bash - name: Install Foundry shell: bash From 9e5ee8b5590421c9daa861c6633ae1530586ff09 Mon Sep 17 00:00:00 2001 From: Borislav Grigorov Date: Wed, 17 Sep 2025 05:42:20 -0700 Subject: [PATCH 91/95] feat(INFRA-2932): add retry to yarn commands self hosted (#126) --- .github/actions/setup-e2e-env/action.yml | 24 ++++++++++++++++-------- 1 file changed, 16 insertions(+), 8 deletions(-) diff --git a/.github/actions/setup-e2e-env/action.yml b/.github/actions/setup-e2e-env/action.yml index 610bbe3a..8d9c6efb 100644 --- a/.github/actions/setup-e2e-env/action.yml +++ b/.github/actions/setup-e2e-env/action.yml @@ -90,7 +90,7 @@ runs: shell: bash ## Android Setup (early for fail-fast) ## - + # Set Android environment variables (self-hosted runner has SDK pre-installed) - name: Set Android environment variables if: ${{ inputs.platform == 'android' }} @@ -165,7 +165,7 @@ runs: shell: bash ## iOS Platform Setup ## - + - name: Configure iOS Signing Certificates if: ${{ inputs.platform == 'ios' && inputs.configure-keystores == 'true' }} uses: MetaMask/github-tools/.github/actions/configure-keystore@self-hosted-runners-config @@ -198,17 +198,25 @@ runs: restore-keys: | ${{ inputs.cache-prefix }}-yarn-${{ inputs.platform }}-${{ runner.os }}- - - name: Install JavaScript dependencies + - name: Install JavaScript dependencies with retry id: yarn-install - run: yarn install --frozen-lockfile - shell: bash + uses: nick-fields/retry@ce71cc2ab81d554ebbe88c79ab5975992d79ba08 #v3.0.2 + with: + timeout_minutes: 15 + max_attempts: 3 + retry_wait_seconds: 30 + command: yarn install --frozen-lockfile env: NODE_OPTIONS: --max-old-space-size=4096 # Increase memory limit for Node.js due to large dependencies - - name: Install Detox CLI + - name: Install Detox CLI with retry id: install-detox-cli - run: yarn global add detox-cli - shell: bash + uses: nick-fields/retry@ce71cc2ab81d554ebbe88c79ab5975992d79ba08 #v3.0.2 + with: + timeout_minutes: 15 + max_attempts: 3 + retry_wait_seconds: 30 + command: yarn global add detox-cli - name: Install Foundry shell: bash From 2f1cdf98c692691e78b21b1334a51a552f2ee22b Mon Sep 17 00:00:00 2001 From: tommasini Date: Wed, 17 Sep 2025 16:00:27 +0100 Subject: [PATCH 92/95] add action to yarn v3 of setup-e2e-env --- .../actions/setup-e2e-env-yarn-v3/action.yml | 339 ++++++++++++++++++ 1 file changed, 339 insertions(+) create mode 100644 .github/actions/setup-e2e-env-yarn-v3/action.yml diff --git a/.github/actions/setup-e2e-env-yarn-v3/action.yml b/.github/actions/setup-e2e-env-yarn-v3/action.yml new file mode 100644 index 00000000..7f9aa3b5 --- /dev/null +++ b/.github/actions/setup-e2e-env-yarn-v3/action.yml @@ -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 From 197371d3bd7728471cb108d108ba7a30b553d302 Mon Sep 17 00:00:00 2001 From: tommasini Date: Wed, 17 Sep 2025 20:11:49 +0100 Subject: [PATCH 93/95] shell bash added --- .github/actions/setup-e2e-env-yarn-v3/action.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/actions/setup-e2e-env-yarn-v3/action.yml b/.github/actions/setup-e2e-env-yarn-v3/action.yml index 7f9aa3b5..a840ee0f 100644 --- a/.github/actions/setup-e2e-env-yarn-v3/action.yml +++ b/.github/actions/setup-e2e-env-yarn-v3/action.yml @@ -127,6 +127,7 @@ runs: - name: Verify Detox CLI run: yarn detox --version + shell: bash - name: Install Foundry shell: bash From 1d567b7602a9f857f925357ad16dfc88173a0f34 Mon Sep 17 00:00:00 2001 From: tommasini Date: Wed, 17 Sep 2025 23:32:30 +0100 Subject: [PATCH 94/95] fix setup e2e env var w yarn v3 --- .../actions/setup-e2e-env-yarn-v3/action.yml | 301 +++++++++--------- 1 file changed, 150 insertions(+), 151 deletions(-) diff --git a/.github/actions/setup-e2e-env-yarn-v3/action.yml b/.github/actions/setup-e2e-env-yarn-v3/action.yml index a840ee0f..aacdc51c 100644 --- a/.github/actions/setup-e2e-env-yarn-v3/action.yml +++ b/.github/actions/setup-e2e-env-yarn-v3/action.yml @@ -1,5 +1,6 @@ -name: 'Setup E2E Test Environment (Yarn v3)' -description: 'Sets up the environment for running E2E tests with Yarn v3 support' +name: 'Setup E2E Test Environment' +description: 'Sets up the environment for running E2E tests' + inputs: platform: description: 'Platform (ios or android)' @@ -40,10 +41,6 @@ inputs: 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 @@ -53,9 +50,9 @@ inputs: required: false default: 'test_e2e_avd' android-device: - description: 'AVD device profile (e.g. "pixel")' + description: 'AVD device profile (e.g. "pixel_5", "pixel", "Nexus 6")' required: false - default: 'pixel' + default: 'pixel_5' android-api-level: description: 'Android API level to use (e.g. "34")' required: false @@ -64,6 +61,14 @@ inputs: description: 'System architecture ABI for the Android system image (e.g. x86_64, arm64-v8a, armeabi-v7a)' required: false default: 'x86_64' + android-tag: + description: 'Android system image tag (e.g. google_apis, default)' + required: false + default: 'google_apis' + android-sdcard-size: + description: 'SD card size for AVD (e.g. 8092M)' + required: false + default: '8092M' configure-keystores: description: 'Whether to configure keystores for E2E tests' required: false @@ -73,24 +78,111 @@ inputs: 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)' + 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" + - run: echo "Setup E2E Environment started" + shell: bash + + ## Android Setup (early for fail-fast) ## + + # Set Android environment variables (self-hosted runner has SDK pre-installed) + - name: Set Android environment variables + if: ${{ inputs.platform == 'android' }} + run: | + echo "ANDROID_HOME=/opt/android-sdk" >> "$GITHUB_ENV" + echo "ANDROID_SDK_ROOT=/opt/android-sdk" >> "$GITHUB_ENV" + shell: bash + + - 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 }} + + ## 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: 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 + ## Android SDK Setup (SDK pre-installed in container) + + - name: Install additional Android SDK components if needed + if: ${{ inputs.platform == 'android' && (inputs.android-api-level != '34' || inputs.android-abi != 'x86_64') }} + run: | + # Only install if different from pre-installed defaults (API 34, x86_64) + IMAGE="system-images;android-${{ inputs.android-api-level }};google_apis;${{ inputs.android-abi }}" + echo "Installing additional system image: $IMAGE" + echo "y" | "/opt/android-sdk/cmdline-tools/latest/bin/sdkmanager" "$IMAGE" + 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 }};${{ inputs.android-tag }};${{ inputs.android-abi }}" + echo "Creating AVD with image: $IMAGE" + "/opt/android-sdk/cmdline-tools/latest/bin/avdmanager" --verbose create avd \ + --force \ + --name "${{ inputs.android-avd-name }}" \ + --package "$IMAGE" \ + --device "${{ inputs.android-device }}" \ + --tag "${{ inputs.android-tag }}" \ + --abi "${{ inputs.android-abi }}" \ + --sdcard "${{ inputs.android-sdcard-size }}" + shell: bash + + ## iOS Platform Setup ## + + - name: Configure iOS Signing Certificates + if: ${{ inputs.platform == 'ios' && inputs.configure-keystores == 'true' }} + uses: MetaMask/github-tools/.github/actions/configure-keystore@self-hosted-runners-config + with: + aws-role-to-assume: ${{ inputs.keystore-role-to-assume }} + aws-region: 'us-east-2' + platform: 'ios' + target: ${{ inputs.target }} + + ## Node.js & JavaScript Dependencies Setup ## + - name: Setup Node.js uses: actions/setup-node@v4 with: node-version: ${{ inputs.node-version }} - ## Yarn v3 Setup & Cache Management + ## Yarn Setup & Cache Management - name: Corepack id: corepack @@ -101,33 +193,30 @@ runs: 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') }} + key: ${{ inputs.cache-prefix }}-yarn-${{ inputs.platform }}-${{ runner.os }}-${{ hashFiles('yarn.lock') }} restore-keys: | - ${{ inputs.cache-prefix }}-yarn-v3-${{ inputs.platform }}-${{ runner.os }}- + ${{ inputs.cache-prefix }}-yarn-${{ inputs.platform }}-${{ runner.os }}- - name: Install JavaScript dependencies with retry id: yarn-install - uses: nick-fields/retry@ce71cc2ab81d554ebbe88c79ab5975992d79ba08 + uses: nick-fields/retry@ce71cc2ab81d554ebbe88c79ab5975992d79ba08 #v3.0.2 with: - timeout_minutes: 10 + timeout_minutes: 15 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 + command: yarn install --immutable 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 - shell: bash + id: install-detox-cli + uses: nick-fields/retry@ce71cc2ab81d554ebbe88c79ab5975992d79ba08 #v3.0.2 + with: + timeout_minutes: 15 + max_attempts: 3 + retry_wait_seconds: 30 + command: yarn detox --version - name: Install Foundry shell: bash @@ -147,14 +236,6 @@ runs: "$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 @@ -167,6 +248,7 @@ runs: - name: Install bundler if: ${{ inputs.platform == 'ios' }} run: gem install bundler -v ${{ inputs.bundler-version }} + working-directory: ios shell: bash # Restore cached Ruby gems @@ -193,10 +275,40 @@ runs: working-directory: ios shell: bash + - name: Generate binstubs for CocoaPods + if: ${{ inputs.platform == 'ios' }} + run: bundle binstubs cocoapods --force --path=vendor/bundle/bin + + working-directory: ios + shell: bash + + - name: Add binstubs to PATH + if: ${{ inputs.platform == 'ios' }} + run: echo "$(pwd)/ios/vendor/bundle/bin" >> "$GITHUB_PATH" + shell: bash + + # Verify CocoaPods is available + - name: Verify CocoaPods + if: ${{ inputs.platform == 'ios' }} + run: | + bundle show cocoapods || (echo "❌ CocoaPods not installed from ios/Gemfile" && exit 1) + bundle exec pod --version + working-directory: ios + shell: bash + + # Verify CocoaPods is available + - name: Verify CocoaPods BinStub + if: ${{ inputs.platform == 'ios' }} + run: | + bundle show cocoapods || (echo "❌ CocoaPods not installed from ios/Gemfile" && exit 1) + pod --version + 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 + run: sudo xcode-select -s /Applications/Xcode_${{ inputs.xcode-version }}.app shell: bash # Restore CocoaPods cache @@ -211,8 +323,8 @@ runs: # Install CocoaPods w/ cached bundler environment - name: Install CocoaPods via bundler - if: ${{ inputs.platform == 'ios' }} - run: bundle exec pod install --repo-update --verbose + if: ${{ inputs.platform == 'ios'}} + run: bundle exec pod install --repo-update working-directory: ios shell: bash @@ -225,116 +337,3 @@ runs: 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 From f1d2c362c1f167c7b35bbbf8b4259268c5dbca17 Mon Sep 17 00:00:00 2001 From: Alejandro Som <560018+alucardzom@users.noreply.github.com> Date: Thu, 18 Sep 2025 15:56:50 +0200 Subject: [PATCH 95/95] chore: add retry to corepack step --- .github/actions/setup-e2e-env/action.yml | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/.github/actions/setup-e2e-env/action.yml b/.github/actions/setup-e2e-env/action.yml index 8d9c6efb..b01c0ccd 100644 --- a/.github/actions/setup-e2e-env/action.yml +++ b/.github/actions/setup-e2e-env/action.yml @@ -184,10 +184,19 @@ runs: ## Yarn Setup & Cache Management + # - name: Corepack + # id: corepack + # run: corepack enable && corepack prepare yarn@${{ inputs.yarn-version }} --activate + # shell: bash + - name: Corepack id: corepack - run: corepack enable && corepack prepare yarn@${{ inputs.yarn-version }} --activate - shell: bash + uses: nick-fields/retry@ce71cc2ab81d554ebbe88c79ab5975992d79ba08 #v3.0.2 + with: + timeout_minutes: 15 + max_attempts: 3 + retry_wait_seconds: 30 + command: corepack enable && corepack prepare yarn@${{ inputs.yarn-version }} --activate - name: Restore Yarn cache uses: actions/cache@v4