|
| 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