Skip to content

Commit fba601f

Browse files
authored
feat: android cirrus temp workflows (#20542)
<!-- Please submit this PR as a draft initially. Do not mark it as "Ready for review" until the template has been completely filled out, and PR status checks have passed at least once. --> ## **Description** Introduces a temporary version of the android CI tests for the cirrus runners so we can do some Capacity planning <!-- Write a short description of the changes included in this pull request, also include relevant motivation and context. Have in mind the following questions: 1. What is the reason for the change? 2. What is the improvement/solution? --> ## **Changelog** <!-- If this PR is not End-User-Facing and should not show up in the CHANGELOG, you can choose to either: 1. Write `CHANGELOG entry: null` 2. Label with `no-changelog` If this PR is End-User-Facing, please write a short User-Facing description in the past tense like: `CHANGELOG entry: Added a new tab for users to see their NFTs` `CHANGELOG entry: Fixed a bug that was causing some NFTs to flicker` (This helps the Release Engineer do their job more quickly and accurately) --> CHANGELOG entry: null ## **Related issues** Fixes: ## **Manual testing steps** ```gherkin Feature: my feature name Scenario: user [verb for user action] Given [describe expected initial app state] When user [verb for user action] Then [describe expected outcome] ``` N/A - CICD Testing only ## **Screenshots/Recordings** <!-- If applicable, add screenshots and/or recordings to visualize the before and after of your change. --> ### **Before** <!-- [screenshots/recordings] --> N/A - CICD Testing only ### **After** <!-- [screenshots/recordings] --> N/A - CICD Testing only ## **Pre-merge author checklist** - [x] 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). - [x] I've completed the PR template to the best of my ability - [x] I’ve included tests if applicable - [x] I’ve documented my code using [JSDoc](https://jsdoc.app/) format if applicable - [x] 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** - [x] I've manually tested the PR (e.g. pull and build branch, run the app, test code being changed). - [x] 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] > Adds temporary Android build and E2E smoke test workflows on Cirrus Ubuntu runners, with artifact upload/reporting, plus runner label and system image setup updates. > > - **CI/CD**: > - **Temporary Android Cirrus workflows**: > - Build APK/AAB and upload artifacts via `/.github/workflows/temp-build-android-e2e-cirrus.yml` (runs on `ghcr.io/cirruslabs/ubuntu-runner-amd64:24.04-xl`). > - Run E2E smoke tests (multiple suites with matrix splits) via `/.github/workflows/temp-run-e2e-smoke-tests-android-cirrus.yml` using `/.github/workflows/temp-run-e2e-workflow-cirrus.yml` (runs on `24.04-lg`). > - Orchestration in `/.github/workflows/temp-android-workflow.yml` gated by `needs_e2e_build` outputs. > - Aggregated reporting with `dorny/test-reporter` and JSON report generation; artifacts downloaded/uploaded. > - **Runner/infra updates**: > - Add Cirrus Ubuntu runner labels in `/.github/actionlint.yaml` (`ghcr.io/cirruslabs/ubuntu-runner-amd64:24.04-lg`, `:24.04-xl`). > - Ensure Android system images installation in `/.github/workflows/test-android-build-app.yml`. > > <sup>Written by [Cursor Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit dede9c1. This will update automatically on new commits. Configure [here](https://cursor.com/dashboard?tab=bugbot).</sup> <!-- /CURSOR_SUMMARY -->
1 parent dd32eb0 commit fba601f

File tree

7 files changed

+653
-1
lines changed

7 files changed

+653
-1
lines changed

.github/actionlint.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@ self-hosted-runner:
99
- "macos-15"
1010
- "ghcr.io/cirruslabs/macos-runner:sequoia"
1111
- "ghcr.io/cirruslabs/macos-runner:sequoia-xl"
12+
- "ghcr.io/cirruslabs/ubuntu-runner-amd64:24.04-lg"
13+
- "ghcr.io/cirruslabs/ubuntu-runner-amd64:24.04-xl"
1214
- "low-priority"
1315

1416
# Configuration variables in array of strings defined in your repository or
Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
# Temporary workflow to test Android builds and E2E tests on Cirrus Ubuntu runners
2+
3+
name: TEMPORARY Android Workflow (Cirrus Testing)
4+
5+
on:
6+
push:
7+
branches: [main]
8+
pull_request:
9+
10+
schedule:
11+
- cron: '0 2-6 * * *'
12+
13+
concurrency:
14+
group: ${{ github.workflow }}-${{ github.ref }}
15+
cancel-in-progress: ${{ !(contains(github.ref, 'refs/heads/main') || contains(github.ref, 'refs/heads/stable')) }}
16+
17+
jobs:
18+
needs_e2e_build:
19+
name: "Detect Mobile Build Changes"
20+
if: ${{ github.event_name != 'merge_group' }}
21+
uses: ./.github/workflows/needs-e2e-build.yml
22+
23+
build-android-apps:
24+
name: "Build Android Apps (Cirrus)"
25+
if: ${{ github.event_name != 'merge_group' && needs.needs_e2e_build.outputs.android_changed == 'true' }}
26+
permissions:
27+
contents: read
28+
id-token: write
29+
needs: [needs_e2e_build]
30+
uses: ./.github/workflows/temp-build-android-e2e-cirrus.yml
31+
secrets: inherit
32+
33+
e2e-smoke-tests-android:
34+
name: "Android E2E Smoke Tests (Cirrus)"
35+
if: ${{ github.event_name != 'merge_group' && needs.needs_e2e_build.outputs.android_changed == 'true' }}
36+
permissions:
37+
contents: read
38+
id-token: write
39+
needs: [needs_e2e_build, build-android-apps]
40+
uses: ./.github/workflows/temp-run-e2e-smoke-tests-android-cirrus.yml
41+
with:
42+
changed_files: ${{ needs.needs_e2e_build.outputs.changed_files }}
43+
secrets: inherit
Lines changed: 148 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,148 @@
1+
# TEMPORARY Cirrus-specific Android E2E build workflow - builds APKs using Cirrus Ubuntu runners
2+
# Temporary workflow for testing Cirrus runners vs self-hosted
3+
4+
name: TEMP Build Android E2E APKs (Cirrus)
5+
6+
on:
7+
workflow_call:
8+
outputs:
9+
apk-uploaded:
10+
description: 'Whether the APK was successfully uploaded'
11+
value: ${{ jobs.build-android-apks-cirrus.outputs.apk-uploaded }}
12+
aab-uploaded:
13+
description: 'Whether the AAB was successfully uploaded'
14+
value: ${{ jobs.build-android-apks-cirrus.outputs.aab-uploaded }}
15+
sourcemap-uploaded:
16+
description: 'Whether the sourcemap was successfully uploaded'
17+
value: ${{ jobs.build-android-apks-cirrus.outputs.sourcemap-uploaded }}
18+
19+
jobs:
20+
build-android-apks-cirrus:
21+
name: Build Android E2E APKs (Cirrus)
22+
runs-on: ghcr.io/cirruslabs/ubuntu-runner-amd64:24.04-xl
23+
env:
24+
GRADLE_USER_HOME: /home/admin/_work/.gradle
25+
outputs:
26+
apk-uploaded: ${{ steps.upload-apk.outcome == 'success' }}
27+
aab-uploaded: ${{ steps.upload-aab.outcome == 'success' }}
28+
sourcemap-uploaded: ${{ steps.upload-sourcemap.outcome == 'success' }}
29+
30+
steps:
31+
- name: Checkout repo
32+
uses: actions/checkout@v4
33+
34+
- name: Install Android System Images
35+
run: |
36+
echo "📱 Installing Android system images for AVD..."
37+
"$ANDROID_SDK_ROOT"/cmdline-tools/latest/bin/sdkmanager "system-images;android-34;google_apis;x86_64"
38+
echo "✅ System images installed"
39+
40+
- name: Setup Android Build Environment
41+
uses: MetaMask/github-tools/.github/actions/setup-e2e-env@2e4ce39610e441f28d50f30af8725ecf6bd540b8
42+
with:
43+
platform: android
44+
setup-simulator: false
45+
configure-keystores: true
46+
target: qa
47+
48+
- name: Cache Gradle dependencies
49+
uses: actions/cache@v4
50+
with:
51+
path: |
52+
/home/admin/_work/.gradle/caches
53+
/home/admin/_work/.gradle/wrapper
54+
android/.gradle
55+
key: gradle-cirrus-${{ runner.os }}-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }}
56+
restore-keys: |
57+
gradle-cirrus-${{ runner.os }}-
58+
59+
- name: Setup project dependencies with retry
60+
uses: nick-fields/retry@ce71cc2ab81d554ebbe88c79ab5975992d79ba08 #v3.0.2
61+
with:
62+
timeout_minutes: 10
63+
max_attempts: 3
64+
retry_wait_seconds: 30
65+
command: |
66+
echo "🚀 Setting up project..."
67+
yarn setup:github-ci --no-build-ios
68+
69+
- name: Build Android E2E APKs
70+
run: |
71+
echo "🏗 Building Android E2E APKs on Cirrus..."
72+
export NODE_OPTIONS="--max-old-space-size=8192"
73+
cp android/gradle.properties.github android/gradle.properties
74+
yarn build:android:main:e2e
75+
shell: bash
76+
env:
77+
PLATFORM: android
78+
METAMASK_ENVIRONMENT: qa
79+
METAMASK_BUILD_TYPE: main
80+
IS_TEST: true
81+
E2E: 'true'
82+
IGNORE_BOXLOGS_DEVELOPMENT: true
83+
GITHUB_CI: 'true'
84+
CI: 'true'
85+
NODE_OPTIONS: '--max-old-space-size=8192'
86+
MM_UNIFIED_SWAPS_ENABLED: 'true'
87+
MM_BRIDGE_ENABLED: 'true'
88+
BRIDGE_USE_DEV_APIS: 'true'
89+
RAMP_INTERNAL_BUILD: 'true'
90+
SEEDLESS_ONBOARDING_ENABLED: 'true'
91+
MM_NOTIFICATIONS_UI_ENABLED: 'true'
92+
MM_SECURITY_ALERTS_API_ENABLED: 'true'
93+
MM_REMOVE_GLOBAL_NETWORK_SELECTOR: 'true'
94+
BLOCKAID_FILE_CDN: 'static.cx.metamask.io/api/v1/confirmations/ppom'
95+
FEATURES_ANNOUNCEMENTS_ACCESS_TOKEN: ${{ secrets.FEATURES_ANNOUNCEMENTS_ACCESS_TOKEN }}
96+
FEATURES_ANNOUNCEMENTS_SPACE_ID: ${{ secrets.FEATURES_ANNOUNCEMENTS_SPACE_ID }}
97+
SEGMENT_WRITE_KEY_QA: ${{ secrets.SEGMENT_WRITE_KEY_QA }}
98+
SEGMENT_PROXY_URL_QA: ${{ secrets.SEGMENT_PROXY_URL_QA }}
99+
SEGMENT_DELETE_API_SOURCE_ID_QA: ${{ secrets.SEGMENT_DELETE_API_SOURCE_ID_QA }}
100+
SEGMENT_REGULATIONS_ENDPOINT_QA: ${{ secrets.SEGMENT_REGULATIONS_ENDPOINT_QA }}
101+
MM_SENTRY_DSN_TEST: ${{ secrets.MM_SENTRY_DSN_TEST }}
102+
MM_SENTRY_AUTH_TOKEN: ${{ secrets.MM_SENTRY_AUTH_TOKEN }}
103+
MAIN_IOS_GOOGLE_CLIENT_ID_UAT: ${{ secrets.MAIN_IOS_GOOGLE_CLIENT_ID_UAT }}
104+
MAIN_IOS_GOOGLE_REDIRECT_URI_UAT: ${{ secrets.MAIN_IOS_GOOGLE_REDIRECT_URI_UAT }}
105+
MAIN_ANDROID_APPLE_CLIENT_ID_UAT: ${{ secrets.MAIN_ANDROID_APPLE_CLIENT_ID_UAT }}
106+
MAIN_ANDROID_GOOGLE_CLIENT_ID_UAT: ${{ secrets.MAIN_ANDROID_GOOGLE_CLIENT_ID_UAT }}
107+
MAIN_ANDROID_GOOGLE_SERVER_CLIENT_ID_UAT: ${{ secrets.MAIN_ANDROID_GOOGLE_SERVER_CLIENT_ID_UAT }}
108+
GOOGLE_SERVICES_B64_IOS: ${{ secrets.GOOGLE_SERVICES_B64_IOS }}
109+
GOOGLE_SERVICES_B64_ANDROID: ${{ secrets.GOOGLE_SERVICES_B64_ANDROID }}
110+
MM_INFURA_PROJECT_ID: ${{ secrets.MM_INFURA_PROJECT_ID }}
111+
112+
- name: Upload Android APK
113+
id: upload-apk
114+
uses: actions/upload-artifact@v4
115+
with:
116+
name: app-prod-release-cirrus.apk
117+
path: android/app/build/outputs/apk/prod/release/app-prod-release.apk
118+
retention-days: 7
119+
if-no-files-found: error
120+
121+
- name: Upload Android Test APK
122+
id: upload-test-apk
123+
uses: actions/upload-artifact@v4
124+
with:
125+
name: app-prod-release-androidTest-cirrus.apk
126+
path: android/app/build/outputs/apk/androidTest/prod/release/app-prod-release-androidTest.apk
127+
retention-days: 7
128+
if-no-files-found: error
129+
130+
- name: Upload Android AAB
131+
id: upload-aab
132+
uses: actions/upload-artifact@v4
133+
with:
134+
name: app-prod-release-cirrus.aab
135+
path: android/app/build/outputs/bundle/prodRelease/app-prod-release.aab
136+
retention-days: 7
137+
if-no-files-found: warn
138+
continue-on-error: true
139+
140+
- name: Upload Android Source Map
141+
id: upload-sourcemap
142+
uses: actions/upload-artifact@v4
143+
with:
144+
name: index.android.bundle-cirrus.map
145+
path: sourcemaps/android/index.android.bundle.map
146+
retention-days: 7
147+
if-no-files-found: warn
148+
continue-on-error: true

0 commit comments

Comments
 (0)