-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
feat(qa-build): update pipeline for generating ios and android builds #17601
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 20 commits
a8b8f77
dd0c3cb
8bf6ad2
d419385
252d39a
fcab962
681540c
a0f3b8c
59042d0
274f3ab
94b070c
6aa089f
4be3d14
58b5872
a76d156
d3facfb
4a41c3e
de4e08e
3f87b95
b55e5a3
eaf3096
789052a
be0fca4
84a0cdd
1164b83
468c92c
e5da965
2ffb430
793f039
f149418
ed308a0
3090d41
75df401
e0d12df
34677c4
a50b491
7b44107
8530500
dfdb84c
ab10e9f
0606b45
c47f490
7aa42a3
4db514b
76e90a8
e76a617
657095f
6bd9738
5fb546c
4d12e33
37cca10
8a4f905
ab46324
640bc08
44a60e0
1ce7a5b
68855bb
8dc8505
af8127e
e350bc3
8a198b8
b85588c
1b498fa
5a031dd
e9ce79a
f749d93
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,157 @@ | ||
| name: Test Android Build QA App | ||
|
|
||
| on: | ||
| push: | ||
cursor[bot] marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| workflow_dispatch: | ||
| inputs: | ||
| retention_days: | ||
| description: 'Number of days to retain artifacts' | ||
| required: false | ||
| default: '7' | ||
| type: string | ||
|
|
||
| permissions: | ||
| contents: write | ||
| id-token: write | ||
|
|
||
| jobs: | ||
| android-build: | ||
| name: Test Android Build QA App | ||
| runs-on: ubuntu-latest | ||
| outputs: | ||
| artifacts-url: ${{ steps.set-artifacts-url.outputs.artifacts-url }} | ||
| apk-uploaded: ${{ steps.upload-apk.outcome == 'success' }} | ||
| aab-uploaded: ${{ steps.upload-aab.outcome == 'success' }} | ||
| sourcemap-uploaded: ${{ steps.upload-sourcemap.outcome == 'success' }} | ||
| steps: | ||
| # Get the source code from the repository | ||
| - name: Checkout repo | ||
| uses: actions/checkout@v4 | ||
|
|
||
| # Install Android SDK, Node.js, and other Android development dependencies | ||
| - name: Installing Android Environment Setup | ||
| uses: MetaMask/github-tools/.github/actions/setup-e2e-env@e2e-env-actions | ||
|
||
| with: | ||
| platform: android | ||
| setup-simulator: false | ||
|
|
||
| # Display Android development tools information for debugging | ||
| - name: Print Android Environment Info | ||
| run: | | ||
| echo "🔧 Node.js Version:" | ||
| node -v || echo "Node not found" | ||
| echo "Android Studio Version:" | ||
| /Applications/Android\ Studio.app/Contents/MacOS/studio --version || echo "Check manually via finder" | ||
| echo "🧶 Yarn Version:" | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. |
||
| yarn -v || echo "Yarn not found" | ||
| echo "📦 SDK Manager Version:" | ||
| sdkmanager --version || echo "sdkmanager not found" | ||
| echo "📱 ADB Version:" | ||
| adb version || echo "adb not found" | ||
| echo "🖥️ Emulator Version:" | ||
| emulator -version || echo "emulator not found" | ||
| echo "🧱 NDK Info:" | ||
| echo "NDK Dir: $ANDROID_SDK_ROOT/ndk/${NDK_VERSION:-unknown}" | ||
| if [ -n "${NDK_VERSION}" ] && [ -f "$ANDROID_SDK_ROOT/ndk/${NDK_VERSION}/source.properties" ]; then | ||
| grep "Pkg.Revision" "$ANDROID_SDK_ROOT/ndk/${NDK_VERSION}/source.properties" || echo "NDK version info not found" | ||
| else | ||
| echo "NDK not found or NDK_VERSION not set" | ||
| fi | ||
| echo "🔧 Checking for ndk-build:" | ||
| command -v ndk-build || echo "ndk-build not found in PATH" | ||
| echo "🔧 Checking for clang:" | ||
| command -v clang || echo "clang not found in PATH" | ||
| echo "🔧 Checking for llvm-ar:" | ||
| command -v llvm-ar || echo "llvm-ar not found in PATH" | ||
| echo "📱 Available AVD Devices:" | ||
| avdmanager list device || echo "avdmanager not found" | ||
| echo "📱 Available System Images:" | ||
| sdkmanager --list | grep "system-images;" || echo "No system images listed" | ||
| echo "🟢 Emulator Processes:" | ||
| pgrep -fl emulator || echo "No running emulator processes" | ||
| echo "📱 Connected Android Devices:" | ||
| adb devices || echo "adb devices failed" | ||
| shell: bash | ||
|
|
||
| # Run project setup and build the Android QA app (APK and AAB) | ||
| - name: Setup Android Environment | ||
| run: | | ||
| echo "🚀 Finishing Android Setup..." | ||
| yarn setup:github-ci --no-build-ios | ||
| echo "🏗 Building Android APP..." | ||
| yarn build:android:qa | ||
| shell: bash | ||
| env: | ||
| PLATFORM: android | ||
| METAMASK_ENVIRONMENT: qa | ||
| METAMASK_BUILD_TYPE: main | ||
| IS_TEST: true | ||
| IGNORE_BOXLOGS_DEVELOPMENT: true | ||
| GITHUB_CI: "true" | ||
| CI: "true" | ||
|
|
||
| SEGMENT_WRITE_KEY_QA: ${{ secrets.SEGMENT_WRITE_KEY_QA }} | ||
| SEGMENT_PROXY_URL_QA: ${{ secrets.SEGMENT_PROXY_URL_QA }} | ||
| SEGMENT_DELETE_API_SOURCE_ID_QA: ${{ secrets.SEGMENT_DELETE_API_SOURCE_ID_QA }} | ||
| SEGMENT_REGULATIONS_ENDPOINT_QA: ${{ secrets.SEGMENT_REGULATIONS_ENDPOINT_QA }} | ||
|
|
||
| MM_SENTRY_DSN_TEST: ${{ secrets.MM_SENTRY_DSN_TEST }} | ||
| MM_SENTRY_AUTH_TOKEN: ${{ secrets.MM_SENTRY_AUTH_TOKEN }} | ||
|
|
||
| MAIN_IOS_GOOGLE_CLIENT_ID_UAT: ${{ secrets.MAIN_IOS_GOOGLE_CLIENT_ID_UAT }} | ||
| MAIN_IOS_GOOGLE_REDIRECT_URI_UAT: ${{ secrets.MAIN_IOS_GOOGLE_REDIRECT_URI_UAT }} | ||
| MAIN_ANDROID_APPLE_CLIENT_ID_UAT: ${{ secrets.MAIN_ANDROID_APPLE_CLIENT_ID_UAT }} | ||
| MAIN_ANDROID_GOOGLE_CLIENT_ID_UAT: ${{ secrets.MAIN_ANDROID_GOOGLE_CLIENT_ID_UAT }} | ||
| MAIN_ANDROID_GOOGLE_SERVER_CLIENT_ID_UAT: ${{ secrets.MAIN_ANDROID_GOOGLE_SERVER_CLIENT_ID_UAT }} | ||
| GOOGLE_SERVICES_B64_IOS: ${{ secrets.GOOGLE_SERVICES_B64_IOS }} | ||
| GOOGLE_SERVICES_B64_ANDROID: ${{ secrets.GOOGLE_SERVICES_B64_ANDROID }} | ||
|
|
||
| # Upload the Android APK file for device installation and testing | ||
| - name: Upload Android APK Artifact | ||
| id: upload-apk | ||
| uses: actions/upload-artifact@v4 | ||
| with: | ||
| name: app-qa-release.apk | ||
| path: android/app/build/outputs/apk/qa/release/app-qa-release.apk | ||
| retention-days: ${{ inputs.retention_days }} | ||
| if-no-files-found: error | ||
| continue-on-error: true | ||
|
|
||
| # Upload the Android App Bundle (AAB) for Play Store distribution | ||
| - name: Upload Android AAB Artifact | ||
| id: upload-aab | ||
| uses: actions/upload-artifact@v4 | ||
| with: | ||
| name: app-qa-release.aab | ||
| path: android/app/build/outputs/bundle/qaRelease/app-qa-release.aab | ||
| retention-days: ${{ inputs.retention_days }} | ||
| if-no-files-found: warn | ||
| continue-on-error: true | ||
|
|
||
| # Upload source map file for crash debugging and error tracking | ||
| - name: Upload Android Source Map | ||
| id: upload-sourcemap | ||
| uses: actions/upload-artifact@v4 | ||
| with: | ||
| name: index.android.bundle.map | ||
| path: sourcemaps/android/index.android.bundle.map | ||
| retention-days: ${{ inputs.retention_days }} | ||
| if-no-files-found: warn | ||
| continue-on-error: true | ||
|
|
||
| # Generate artifact download URL and display upload status summary | ||
| - name: Set Artifacts URL and Status | ||
| id: set-artifacts-url | ||
| run: | | ||
| ARTIFACTS_URL="https://github.com/${GITHUB_REPOSITORY}/actions/runs/${GITHUB_RUN_ID}" | ||
| echo "artifacts-url=${ARTIFACTS_URL}" >> "$GITHUB_OUTPUT" | ||
| echo "📦 Artifacts available at: ${ARTIFACTS_URL}" | ||
| echo "" | ||
| echo "Upload Status Summary:" | ||
| echo "- 🤖 APK: ${{ steps.upload-apk.outcome }}" | ||
| echo "- 📦 AAB Bundle: ${{ steps.upload-aab.outcome }}" | ||
| echo "- 📦 Source Map: ${{ steps.upload-sourcemap.outcome }}" | ||
|
|
||
| env: | ||
| GITHUB_REPOSITORY: "${{ github.repository }}" | ||
| GITHUB_RUN_ID: "${{ github.run_id }}" | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,170 @@ | ||
| name: Test iOS Build QA App | ||
|
|
||
| on: | ||
| push: | ||
|
||
| workflow_dispatch: | ||
| inputs: | ||
| retention_days: | ||
| description: 'Number of days to retain the uploaded artifacts' | ||
| required: false | ||
| default: '7' | ||
| type: string | ||
|
|
||
| permissions: | ||
| contents: write | ||
| id-token: write | ||
|
|
||
| jobs: | ||
| ios-build: | ||
| name: Test iOS QA Build App | ||
| runs-on: macos-15 | ||
| outputs: | ||
| artifacts-url: ${{ steps.set-artifacts-url.outputs.artifacts-url }} | ||
| app-uploaded: ${{ steps.upload-app.outcome == 'success' }} | ||
| ipa-uploaded: ${{ steps.upload-ipa.outcome == 'success' }} | ||
| archive-uploaded: ${{ steps.upload-archive.outcome == 'success' }} | ||
| sourcemap-uploaded: ${{ steps.upload-sourcemap.outcome == 'success' }} | ||
| env: | ||
| GITHUB_CI: "true" # ✅ This ensures it's available during pod install | ||
| steps: | ||
| # Get the source code from the repository | ||
| - name: Checkout repo | ||
| uses: actions/checkout@v4 | ||
|
|
||
| # Display system information for debugging purposes | ||
| - name: Detect CPU architecture | ||
| run: | | ||
| echo "Arch: $(uname -m)" | ||
| if [[ "$(uname -m)" == "x86_64" ]]; then | ||
| echo "Detected Intel runner" | ||
| else | ||
| echo "Detected Apple Silicon runner" | ||
| fi | ||
|
|
||
| - name: Print system resources | ||
| run: | | ||
| echo "🧠 Memory info:" | ||
| vm_stat | ||
| echo "" | ||
| echo "💻 CPU info:" | ||
| sysctl -n hw.ncpu | ||
| sysctl -n hw.memsize | awk '{ byte =$1 /1024/1024/1024; print byte " GB" }' | ||
| shell: bash | ||
|
|
||
| # Install Node.js, Xcode tools, and other iOS development dependencies | ||
| - name: Installing iOS Environment Setup | ||
| uses: MetaMask/github-tools/.github/actions/setup-e2e-env@e2e-env-actions | ||
| with: | ||
| platform: ios | ||
| setup-simulator: false | ||
|
|
||
| - name: Print iOS tool versions | ||
| run: | | ||
| echo "🔧 Node.js Version:" | ||
| node -v || echo "Node not found" | ||
| echo "🧶 Yarn Version:" | ||
| yarn -v || echo "Yarn not found" | ||
| echo "📦 CocoaPods Version:" | ||
| pod --version || echo "CocoaPods not found" | ||
| echo "🛠️ Xcode Path:" | ||
| xcode-select -p || echo "Xcode not found" | ||
| echo "📱 Booted iOS Simulators:" | ||
| xcrun simctl list | grep Booted || echo "No booted simulators found" | ||
| shell: bash | ||
|
|
||
| # Run project setup and build the iOS QA app for simulator | ||
| - name: Setup iOS Environment | ||
| run: | | ||
| echo "🚀 Finishing iOS Setup..." | ||
| yarn setup:github-ci --build-ios --no-build-android | ||
| echo "🏗 Building iOS APP..." | ||
| yarn build:ios:qa | ||
| shell: bash | ||
| env: | ||
| PLATFORM: ios | ||
| METAMASK_ENVIRONMENT: qa | ||
| METAMASK_BUILD_TYPE: main | ||
| IS_TEST: true | ||
| IGNORE_BOXLOGS_DEVELOPMENT: true | ||
| GITHUB_CI: "true" | ||
| CI: "true" | ||
|
|
||
| NODE_OPTIONS: "--max_old_space_size=4096" # Increase memory limit for build, specially on GH Runners | ||
cursor[bot] marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
|
||
| SEGMENT_WRITE_KEY_QA: ${{ secrets.SEGMENT_WRITE_KEY_QA }} | ||
| SEGMENT_PROXY_URL_QA: ${{ secrets.SEGMENT_PROXY_URL_QA }} | ||
| SEGMENT_DELETE_API_SOURCE_ID_QA: ${{ secrets.SEGMENT_DELETE_API_SOURCE_ID_QA }} | ||
| SEGMENT_REGULATIONS_ENDPOINT_QA: ${{ secrets.SEGMENT_REGULATIONS_ENDPOINT_QA }} | ||
|
|
||
| MM_SENTRY_DSN_TEST: ${{ secrets.MM_SENTRY_DSN_TEST }} | ||
| MM_SENTRY_AUTH_TOKEN: ${{ secrets.MM_SENTRY_AUTH_TOKEN }} | ||
|
|
||
| MAIN_IOS_GOOGLE_CLIENT_ID_UAT: ${{ secrets.MAIN_IOS_GOOGLE_CLIENT_ID_UAT }} | ||
| MAIN_IOS_GOOGLE_REDIRECT_URI_UAT: ${{ secrets.MAIN_IOS_GOOGLE_REDIRECT_URI_UAT }} | ||
| MAIN_ANDROID_APPLE_CLIENT_ID_UAT: ${{ secrets.MAIN_ANDROID_APPLE_CLIENT_ID_UAT }} | ||
| MAIN_ANDROID_GOOGLE_CLIENT_ID_UAT: ${{ secrets.MAIN_ANDROID_GOOGLE_CLIENT_ID_UAT }} | ||
| MAIN_ANDROID_GOOGLE_SERVER_CLIENT_ID_UAT: ${{ secrets.MAIN_ANDROID_GOOGLE_SERVER_CLIENT_ID_UAT }} | ||
| GOOGLE_SERVICES_B64_IOS: ${{ secrets.GOOGLE_SERVICES_B64_IOS }} | ||
| GOOGLE_SERVICES_B64_ANDROID: ${{ secrets.GOOGLE_SERVICES_B64_ANDROID }} | ||
|
|
||
| # Upload the iOS .app file that works in simulators (no certificates needed) | ||
| - name: Upload iOS APP Artifact (Simulator) | ||
| id: upload-app | ||
| uses: actions/upload-artifact@v4 | ||
| with: | ||
| name: MetaMask-QA.app | ||
| path: ios/build/Build/Products/Release-iphonesimulator/MetaMask-QA.app | ||
| retention-days: ${{ inputs.retention_days }} | ||
| if-no-files-found: error | ||
| continue-on-error: true | ||
|
|
||
| # Upload iOS .ipa file for device installation (requires certificates - may not exist) | ||
| - name: Upload iOS IPA Artifact (Device) | ||
| id: upload-ipa | ||
| uses: actions/upload-artifact@v4 | ||
| with: | ||
| name: MetaMask-QA.ipa | ||
| path: ios/build/output/MetaMask-QA.ipa | ||
| retention-days: ${{ inputs.retention_days }} | ||
| if-no-files-found: error | ||
| continue-on-error: true | ||
|
|
||
| # Upload iOS .xcarchive file for debugging and re-signing (requires certificates - may not exist) | ||
| - name: Upload iOS Archive Artifact | ||
| id: upload-archive | ||
| uses: actions/upload-artifact@v4 | ||
| with: | ||
| name: MetaMask-QA.xcarchive | ||
| path: ios/build/MetaMask-QA.xcarchive | ||
| retention-days: ${{ inputs.retention_days }} | ||
| if-no-files-found: error | ||
| continue-on-error: true | ||
|
|
||
| # Upload source map file for crash debugging and error tracking if exists | ||
| - name: Upload iOS Source Map | ||
| id: upload-sourcemap | ||
| uses: actions/upload-artifact@v4 | ||
| with: | ||
| name: index.js.map | ||
| path: sourcemaps/ios/index.js.map | ||
| retention-days: ${{ inputs.retention_days }} | ||
| if-no-files-found: error | ||
| continue-on-error: true | ||
|
|
||
| # Generate artifact download URL and display upload status summary | ||
| - name: Set Artifacts URL and Status | ||
| id: set-artifacts-url | ||
| run: | | ||
| ARTIFACTS_URL="https://github.com/${GITHUB_REPOSITORY}/actions/runs/${GITHUB_RUN_ID}" | ||
| echo "artifacts-url=${ARTIFACTS_URL}" >> "$GITHUB_OUTPUT" | ||
| echo "📦 Artifacts available at: ${ARTIFACTS_URL}" | ||
| echo "" | ||
| echo "Upload Status Summary:" | ||
| echo "- APP (Simulator): ${{ steps.upload-app.outcome }}" | ||
| echo "- IPA (Device): ${{ steps.upload-ipa.outcome }}" | ||
| echo "- Archive: ${{ steps.upload-archive.outcome }}" | ||
| echo "- Source Map: ${{ steps.upload-sourcemap.outcome }}" | ||
|
|
||
| env: | ||
| GITHUB_REPOSITORY: "${{ github.repository }}" | ||
| GITHUB_RUN_ID: "${{ github.run_id }}" | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should be removed, added for testing into this branch