Skip to content

Commit 54848c1

Browse files
authored
ci(actions): setup-e2e-env skip guards (Android, runner_provider input) (#29780)
## **Description** Phase 2 of INFRA-3594 — adds a `runner_provider` input to the `setup-e2e-env` composite action and short-circuits Android toolchain-install steps when the caller declares `runner_provider == 'namespace'` (the metamask-android-build image already bakes the pinned toolchain). **`.github/actions/setup-e2e-env/action.yml`**: - New `runner_provider` input. Default `current` — preserves byte-identical behaviour for existing GitHub-hosted / Cirrus callers. - `Setup Java` step skipped when `inputs.runner_provider == 'namespace'` (Temurin 17 is baked at `/usr/lib/jvm/temurin-17-jdk-amd64`; Gradle resolves it from the image's OS env). - `Install required emulator dependencies` (apt-get) skipped when `inputs.runner_provider == 'namespace'` (libpulse0 / libglu1-mesa / libnss3 / libxss1 are pre-installed). **Caller wiring** — forwards `runner_provider` from each reusable workflow into the action's `with:` block: - `build-android-e2e.yml` - `build-ios-e2e.yml` - `run-e2e-workflow.yml` `update-e2e-fixtures.yml` is intentionally untouched — it has no Phase 0 `runner_provider` input and its `runs-on` has no namespace ternary. iOS-side guards investigated and deferred: no meaningful skip targets due to version mismatches. `applesimutils` is self-guarded internally; `xcodes select` must run because Tahoe defaults to 26.1.1; Ruby/Bundler pin mismatches force install. actionlint clean (zero baseline drift). **End-to-end validation** on namespace: https://github.com/MetaMask/metamask-mobile/actions/runs/25546769544 - Build Android E2E APKs ✓ (19m20s) — `Setup Java` step verified skipped (no `Run actions/setup-java` log group; Gradle picked up Temurin 17 from the baked image). - All 26 Android E2E smoke jobs ✓. - iOS smoke timeouts on this run are unrelated macOS-runner issues (iOS Build ✓; iOS path doesn't traverse `Setup Java`). Re-run dispatched. - Validation after fixing conflicts https://github.com/MetaMask/metamask-mobile/actions/runs/25659336212/job/75324978097 ## **Changelog** CHANGELOG entry: null ## **Related issues** Fixes: INFRA-3594 ## **Manual testing steps** ```gherkin Feature: setup-e2e-env runner_provider input Scenario: namespace dispatch skips toolchain install Given the metamask-android-build image bakes Temurin 17 and emulator apt-deps When CI is dispatched with runner_provider=namespace Then Setup Java step is skipped (no `Run actions/setup-java` log group) And Install required emulator dependencies step is skipped And Build Android E2E APKs succeeds using JDK 17 from the image And all 26 Android E2E smoke jobs pass Scenario: existing callers see no behaviour change Given runner_provider defaults to "current" When a caller does not pass runner_provider Then Setup Java and apt-deps steps run as before on GitHub-hosted / Cirrus runners ``` ## **Screenshots/Recordings** N/A — CI/infra-only change. ## **Pre-merge author checklist** - [ ] I've followed [MetaMask Contributor Docs](https://github.com/MetaMask/contributor-docs) and [MetaMask Mobile Coding Standards](https://github.com/MetaMask/metamask-mobile/blob/main/.github/guidelines/CODING_GUIDELINES.md). - [ ] I've completed the PR template to the best of my ability - [ ] I've included tests if applicable - [ ] I've documented my code using [JSDoc](https://jsdoc.app/) format if applicable - [ ] I've applied the right labels on the PR (see [labeling guidelines](https://github.com/MetaMask/metamask-mobile/blob/main/.github/guidelines/LABELING_GUIDELINES.md)). Not required for external contributors. ## **Pre-merge reviewer checklist** - [ ] I've manually tested the PR (e.g. pull and build branch, run the app, test code being changed). - [ ] I confirm that this PR addresses all acceptance criteria described in the ticket it closes and includes the necessary testing evidence such as recordings and or screenshots. <!-- CURSOR_SUMMARY --> --- > [!NOTE] > **Medium Risk** > Medium risk because it changes CI setup conditions and can break Android builds/tests if `runner_provider` is mis-set or runner images diverge from the assumed baked toolchain/deps. > > **Overview** > Introduces a new `runner_provider` input on the `setup-e2e-env` composite action (default `current`) and uses it to **short-circuit Android-only setup** on Namespace runners. > > When `runner_provider == 'namespace'`, the action now skips `actions/setup-java` and the Linux `apt-get` emulator dependency install, and the reusable workflows `build-android-e2e.yml`, `build-ios-e2e.yml`, and `run-e2e-workflow.yml` forward `runner_provider` into the action’s `with:` block. > > <sup>Reviewed by [Cursor Bugbot](https://cursor.com/bugbot) for commit f1d87fa. Bugbot is set up for automated code reviews on this repo. Configure [here](https://www.cursor.com/dashboard/bugbot).</sup> <!-- /CURSOR_SUMMARY -->
1 parent 0dc3a22 commit 54848c1

4 files changed

Lines changed: 12 additions & 2 deletions

File tree

.github/actions/setup-e2e-env/action.yml

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,10 @@ inputs:
8787
description: 'Target for which the keystore is being configured (e.g. flask, main)'
8888
required: false
8989
default: 'qa'
90+
runner_provider:
91+
description: 'Runner provider forwarded from the caller workflow chain. When set to "namespace", toolchain-install steps short-circuit if the pinned version is already on the image. Default "current" preserves byte-identical behaviour on existing GitHub-hosted / Cirrus runners.'
92+
required: false
93+
default: 'current'
9094

9195
runs:
9296
using: 'composite'
@@ -116,14 +120,17 @@ runs:
116120

117121
## JDK Setup
118122
- name: Setup Java
119-
if: ${{ inputs.platform == 'android' }}
123+
# Skip on namespace runners — the metamask-android-build image bakes Temurin 17.
124+
if: ${{ inputs.platform == 'android' && inputs.runner_provider != 'namespace' }}
120125
uses: actions/setup-java@c5195efecf7bdfc987ee8bae7a71cb8b11521c00
121126
with:
122127
java-version: ${{ inputs.jdk-version }}
123128
distribution: ${{ inputs.jdk-distribution }}
124129

125130
- name: Install required emulator dependencies
126-
if: ${{ inputs.platform == 'android' && inputs.setup-simulator == 'true' && runner.os == 'Linux' }}
131+
# Skip apt-get install on namespace — libpulse0 / libglu1-mesa / libnss3 / libxss1
132+
# are baked into the metamask-android-build image.
133+
if: ${{ inputs.platform == 'android' && inputs.setup-simulator == 'true' && runner.os == 'Linux' && inputs.runner_provider != 'namespace' }}
127134
uses: nick-fields/retry@ce71cc2ab81d554ebbe88c79ab5975992d79ba08 #v3.0.2
128135
with:
129136
timeout_minutes: 5

.github/workflows/build-android-e2e.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -193,6 +193,7 @@ jobs:
193193
setup-simulator: false
194194
configure-keystores: true
195195
install-foundry: false
196+
runner_provider: ${{ inputs.runner_provider }}
196197

197198
# The Namespace cache action above already includes `.metamask`, so the
198199
# dedicated actions/cache restore is only needed on non-Namespace runners.

.github/workflows/build-ios-e2e.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -174,6 +174,7 @@ jobs:
174174
platform: ios
175175
setup-simulator: false
176176
install-foundry: false
177+
runner_provider: ${{ inputs.runner_provider }}
177178

178179
- name: Print iOS tool versions
179180
if: ${{ steps.gate.outputs.needs-native-build == 'true' }}

.github/workflows/run-e2e-workflow.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -118,6 +118,7 @@ jobs:
118118
android-avd-name: emulator
119119
android-api-level: 36
120120
configure-keystores: false
121+
runner_provider: ${{ inputs.runner_provider }}
121122

122123
- name: Build Detox framework cache (iOS)
123124
if: ${{ inputs.platform == 'ios' }}

0 commit comments

Comments
 (0)