Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 25 additions & 3 deletions .github/workflows/build-android-e2e.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ jobs:
CACHE_GENERATION: v1 # Increment this to bust the cache (v1, v2, v3, etc.)
YARN_ENABLE_GLOBAL_CACHE: 'true' # Enable Yarn global cache for faster installs
outputs:
apk-uploaded: ${{ steps.upload-apk.outcome == 'success' }}
apk-uploaded: ${{ steps.upload-apk-namespace.outcome == 'success' || steps.upload-apk.outcome == 'success' }}
apk-target-path: ${{ steps.determine-target-paths.outputs.apk-target-path }}
test-apk-target-path: ${{ steps.determine-target-paths.outputs.test-apk-target-path }}
artifact_name: ${{ steps.determine-target-paths.outputs.artifact_name }}
Expand Down Expand Up @@ -452,17 +452,39 @@ jobs:
GOOGLE_SERVICES_B64_ANDROID: ${{ secrets.GOOGLE_SERVICES_B64_ANDROID }}
MM_INFURA_PROJECT_ID: ${{ secrets.MM_INFURA_PROJECT_ID }}

- name: Upload Android APK
- name: Upload Android APK (Namespace)
id: upload-apk-namespace
if: ${{ inputs.runner_provider == 'namespace' }}
uses: namespace-actions/upload-artifact@f6ccaacc655aec41b93af180d1d7eef21af862d2 # v1.0.3
with:
name: ${{ inputs.build_type }}-${{ inputs.metamask_environment }}-release.apk
path: ${{ steps.determine-target-paths.outputs.apk-target-path }}/${{ steps.determine-target-paths.outputs.artifact_name }}.apk
retention-days: 7
if-no-files-found: error

- name: Upload Android APK (current)
id: upload-apk
if: ${{ inputs.runner_provider != 'namespace' }}
uses: actions/upload-artifact@v4
with:
name: ${{ inputs.build_type }}-${{ inputs.metamask_environment }}-release.apk
path: ${{ steps.determine-target-paths.outputs.apk-target-path }}/${{ steps.determine-target-paths.outputs.artifact_name }}.apk
retention-days: 7
if-no-files-found: error

- name: Upload Android Test APK
- name: Upload Android Test APK (Namespace)
id: upload-test-apk-namespace
if: ${{ inputs.runner_provider == 'namespace' }}
uses: namespace-actions/upload-artifact@f6ccaacc655aec41b93af180d1d7eef21af862d2 # v1.0.3
with:
name: ${{ inputs.build_type }}-${{ inputs.metamask_environment }}-release-androidTest.apk
path: ${{ steps.determine-target-paths.outputs.test-apk-target-path }}/${{ steps.determine-target-paths.outputs.artifact_name }}-androidTest.apk
retention-days: 7
if-no-files-found: error

- name: Upload Android Test APK (current)
id: upload-test-apk
if: ${{ inputs.runner_provider != 'namespace' }}
uses: actions/upload-artifact@v4
with:
name: ${{ inputs.build_type }}-${{ inputs.metamask_environment }}-release-androidTest.apk
Expand Down
39 changes: 32 additions & 7 deletions .github/workflows/build-ios-e2e.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,8 @@ jobs:
runs-on: ${{ inputs.runner_provider == 'namespace' && 'namespace-profile-metamask-ios-build' || (startsWith(github.base_ref, 'release/') && fromJSON('["ghcr.io/cirruslabs/macos-runner:tahoe-xl"]') || fromJSON('["ghcr.io/cirruslabs/macos-runner:tahoe-xl", "low-priority"]')) }}
outputs:
artifacts-url: ${{ steps.set-artifacts-url.outputs.artifacts-url }}
app-uploaded: ${{ steps.upload-app.outcome == 'success' }}
sourcemap-uploaded: ${{ steps.upload-sourcemap.outcome == 'success' }}
app-uploaded: ${{ steps.upload-app-namespace.outcome == 'success' || steps.upload-app.outcome == 'success' }}
sourcemap-uploaded: ${{ steps.upload-sourcemap-namespace.outcome == 'success' || steps.upload-sourcemap.outcome == 'success' }}
env:
XCODE_CACHE_VERSION: 1
RCT_NO_LAUNCH_PACKAGER: 1
Expand Down Expand Up @@ -112,7 +112,8 @@ jobs:

- name: Find reusable build from prior run
id: find-reusable-build
if: ${{ steps.force-builds.outputs.force != 'true' && inputs.source-fingerprint != '' }}
# Match Android: skip cross-run GitHub artifact reuse on Namespace until backend parity is proven.
if: ${{ inputs.runner_provider != 'namespace' && steps.force-builds.outputs.force != 'true' && inputs.source-fingerprint != '' }}
uses: ./.github/actions/find-reusable-build
with:
fingerprint: ${{ inputs.source-fingerprint }}
Expand Down Expand Up @@ -385,8 +386,20 @@ jobs:
shell: bash

# Upload the iOS .app file that works in simulators
- name: Upload iOS APP Artifact (Simulator)
- name: Upload iOS APP Artifact (Simulator) (Namespace)
id: upload-app-namespace
if: ${{ inputs.runner_provider == 'namespace' }}
uses: namespace-actions/upload-artifact@f6ccaacc655aec41b93af180d1d7eef21af862d2 # v1.0.3
with:
name: ${{ inputs.build_type }}-${{ inputs.metamask_environment }}-MetaMask.app
path: ios/build/Build/Products/Release-iphonesimulator/MetaMask.app
retention-days: 7
if-no-files-found: error
continue-on-error: true

- name: Upload iOS APP Artifact (Simulator) (current)
id: upload-app
if: ${{ inputs.runner_provider != 'namespace' }}
uses: actions/upload-artifact@v4
with:
name: ${{ inputs.build_type }}-${{ inputs.metamask_environment }}-MetaMask.app
Expand All @@ -399,8 +412,20 @@ jobs:
# Both paths produce it: `yarn build:ios:main:e2e` via
# `scripts/ios/bundle-js-and-sentry-upload.sh` and `yarn build:repack:ios`
# via `scripts/repack.js` both write to `sourcemaps/ios/index.js.map`.
- name: Upload iOS Source Map
- name: Upload iOS Source Map (Namespace)
id: upload-sourcemap-namespace
if: ${{ inputs.runner_provider == 'namespace' }}
uses: namespace-actions/upload-artifact@f6ccaacc655aec41b93af180d1d7eef21af862d2 # v1.0.3
with:
name: ${{ inputs.build_type }}-${{ inputs.metamask_environment }}-index.js.map
path: sourcemaps/ios/index.js.map
retention-days: 7
if-no-files-found: error
continue-on-error: true

- name: Upload iOS Source Map (current)
id: upload-sourcemap
if: ${{ inputs.runner_provider != 'namespace' }}
uses: actions/upload-artifact@v4
with:
name: ${{ inputs.build_type }}-${{ inputs.metamask_environment }}-index.js.map
Expand All @@ -418,8 +443,8 @@ jobs:
echo "📦 Artifacts available at: ${ARTIFACTS_URL}"
echo ""
echo "Upload Status Summary:"
echo "- APP (Simulator): ${{ steps.upload-app.outcome }}"
echo "- Source Map: ${{ steps.upload-sourcemap.outcome }}"
echo "- APP (Simulator): namespace=${{ steps.upload-app-namespace.outcome }} current=${{ steps.upload-app.outcome }}"
echo "- Source Map: namespace=${{ steps.upload-sourcemap-namespace.outcome }} current=${{ steps.upload-sourcemap.outcome }}"

env:
GITHUB_REPOSITORY: '${{ github.repository }}'
Expand Down
149 changes: 134 additions & 15 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -490,7 +490,15 @@ jobs:
"https://api.github.com/repos/${GITHUB_REPOSITORY}/statuses/${COMMIT_SHA}" \
-d "$BODY"

- name: Upload iOS bundle
- name: Upload iOS bundle (Namespace)
if: ${{ inputs.runner_provider == 'namespace' }}
uses: namespace-actions/upload-artifact@f6ccaacc655aec41b93af180d1d7eef21af862d2 # v1.0.3
with:
name: ios-bundle
path: ios/main.jsbundle
retention-days: 7
- name: Upload iOS bundle (current)
if: ${{ inputs.runner_provider != 'namespace' }}
uses: actions/upload-artifact@v4
with:
name: ios-bundle
Expand All @@ -508,7 +516,14 @@ jobs:
- uses: actions/checkout@v6
if: ${{ inputs.runner_provider != 'namespace' }}

- name: Download iOS bundle
- name: Download iOS bundle (Namespace)
if: ${{ inputs.runner_provider == 'namespace' }}
uses: namespace-actions/download-artifact@7cbad919e4b0e09f17e9d6311a444ff002992b5b # v2.0.1
with:
name: ios-bundle
path: ios
- name: Download iOS bundle (current)
if: ${{ inputs.runner_provider != 'namespace' }}
uses: actions/download-artifact@v4
with:
name: ios-bundle
Expand Down Expand Up @@ -597,8 +612,8 @@ jobs:
run: mkdir -p tests/results
# The "10" in this command is the total number of shards. It must be kept
# in sync with the length of matrix.shard
# Namespace Linux: cap Jest workers to reduce cgroup OOM SIGKILL without tuning heap.
- run: yarn test:unit --shard=${{ matrix.shard }}/10${{ inputs.runner_provider == 'namespace' && ' --maxWorkers=50%' || '' }} --forceExit --silent --coverageReporters=json --json --outputFile=tests/results/unit-test-results-${{ matrix.shard }}.json
# Namespace Linux: --maxWorkers=33% (~3 workers on 8 vCPU) + 12GiB heap; GitHub-hosted keeps 20480.
- run: yarn test:unit --shard=${{ matrix.shard }}/10${{ inputs.runner_provider == 'namespace' && ' --maxWorkers=33%' || '' }} --forceExit --silent --coverageReporters=json --json --outputFile=tests/results/unit-test-results-${{ matrix.shard }}.json
env:
NODE_OPTIONS: ${{ inputs.runner_provider == 'namespace' && '--max_old_space_size=12288' || '--max_old_space_size=20480' }}
- name: Rename coverage report and extract test count for this shard
Expand All @@ -608,7 +623,17 @@ jobs:
cp tests/results/unit-test-results-${{ matrix.shard }}.json ./tests/coverage/jest-results.json
count=$(jq '(.numPassedTests // 0) + (.numFailedTests // 0)' tests/results/unit-test-results-${{ matrix.shard }}.json)
echo "{\"count\": $count}" > ./tests/coverage/count.json
- uses: actions/upload-artifact@v4
- name: Upload coverage unit shard (Namespace)
if: ${{ inputs.runner_provider == 'namespace' }}
uses: namespace-actions/upload-artifact@f6ccaacc655aec41b93af180d1d7eef21af862d2 # v1.0.3
with:
name: coverage-unit-${{ matrix.shard }}
path: ./tests/coverage/
if-no-files-found: error
retention-days: 7
- name: Upload coverage unit shard (current)
if: ${{ inputs.runner_provider != 'namespace' }}
uses: actions/upload-artifact@v4
with:
name: coverage-unit-${{ matrix.shard }}
path: ./tests/coverage/
Expand Down Expand Up @@ -667,7 +692,15 @@ jobs:
command: yarn install --immutable
- name: Clean state and following up dependencies installation
run: yarn setup:github-ci --node
- uses: actions/download-artifact@v4
- name: Download coverage shards (Namespace)
if: ${{ inputs.runner_provider == 'namespace' }}
uses: namespace-actions/download-artifact@7cbad919e4b0e09f17e9d6311a444ff002992b5b # v2.0.1
with:
pattern: coverage-*
path: tests/coverage/
- name: Download coverage shards (current)
if: ${{ inputs.runner_provider != 'namespace' }}
uses: actions/download-artifact@v4
with:
pattern: coverage-*
path: tests/coverage/
Expand Down Expand Up @@ -705,41 +738,101 @@ jobs:
find ./tests/coverage/coverage-* -name 'coverage-*.json' -exec mv {} ./tests/coverage/ \;
- run: yarn test:merge-coverage
- run: yarn test:validate-coverage
- uses: actions/upload-artifact@v4
- name: Upload lcov.info (Namespace)
if: ${{ inputs.runner_provider == 'namespace' }}
uses: namespace-actions/upload-artifact@f6ccaacc655aec41b93af180d1d7eef21af862d2 # v1.0.3
with:
name: lcov.info
path: ./tests/merged-coverage/lcov.info
if-no-files-found: error
retention-days: 7
- name: Upload lcov.info (current)
if: ${{ inputs.runner_provider != 'namespace' }}
uses: actions/upload-artifact@v4
with:
name: lcov.info
path: ./tests/merged-coverage/lcov.info
if-no-files-found: error
retention-days: 7
- uses: actions/upload-artifact@v4
- name: Upload cv-test-stats (Namespace)
if: ${{ inputs.runner_provider == 'namespace' }}
uses: namespace-actions/upload-artifact@f6ccaacc655aec41b93af180d1d7eef21af862d2 # v1.0.3
with:
name: cv-test-stats
path: ./cv-test-stats.json
if-no-files-found: error
retention-days: 7
- uses: actions/upload-artifact@v4
- name: Upload cv-test-stats (current)
if: ${{ inputs.runner_provider != 'namespace' }}
uses: actions/upload-artifact@v4
with:
name: cv-test-stats
path: ./cv-test-stats.json
if-no-files-found: error
retention-days: 7
- name: Upload unit-test-stats (Namespace)
if: ${{ inputs.runner_provider == 'namespace' }}
uses: namespace-actions/upload-artifact@f6ccaacc655aec41b93af180d1d7eef21af862d2 # v1.0.3
with:
name: unit-test-stats
path: ./unit-test-stats.json
if-no-files-found: error
retention-days: 7
- name: Upload unit-test-stats (current)
if: ${{ inputs.runner_provider != 'namespace' }}
uses: actions/upload-artifact@v4
with:
name: unit-test-stats
path: ./unit-test-stats.json
if-no-files-found: error
retention-days: 7
- name: Generate CV test coverage report
run: yarn nyc report --temp-dir ./tests/coverage-cv-merged --report-dir ./tests/coverage-cv-lcov --reporter html --reporter json-summary
- uses: actions/upload-artifact@v4
- name: Upload cv-test-coverage-html (Namespace)
if: ${{ inputs.runner_provider == 'namespace' }}
uses: namespace-actions/upload-artifact@f6ccaacc655aec41b93af180d1d7eef21af862d2 # v1.0.3
with:
name: cv-test-coverage-html
path: ./tests/coverage-cv-lcov/
if-no-files-found: error
retention-days: 7
- name: Upload cv-test-coverage-html (current)
if: ${{ inputs.runner_provider != 'namespace' }}
uses: actions/upload-artifact@v4
with:
name: cv-test-coverage-html
path: ./tests/coverage-cv-lcov/
if-no-files-found: error
retention-days: 7
- uses: actions/upload-artifact@v4
- name: Upload cv-test-coverage-summary (Namespace)
if: ${{ inputs.runner_provider == 'namespace' }}
uses: namespace-actions/upload-artifact@f6ccaacc655aec41b93af180d1d7eef21af862d2 # v1.0.3
with:
name: cv-test-coverage-summary
path: ./tests/coverage-cv-lcov/coverage-summary.json
if-no-files-found: error
retention-days: 7
- name: Upload cv-test-coverage-summary (current)
if: ${{ inputs.runner_provider != 'namespace' }}
uses: actions/upload-artifact@v4
with:
name: cv-test-coverage-summary
path: ./tests/coverage-cv-lcov/coverage-summary.json
if-no-files-found: error
retention-days: 7
- name: Generate unit test coverage summary
run: yarn nyc report --temp-dir ./tests/coverage-unit-merged --report-dir ./tests/coverage-unit-lcov --reporter json-summary
- uses: actions/upload-artifact@v4
- name: Upload unit-test-coverage-summary (Namespace)
if: ${{ inputs.runner_provider == 'namespace' }}
uses: namespace-actions/upload-artifact@f6ccaacc655aec41b93af180d1d7eef21af862d2 # v1.0.3
with:
name: unit-test-coverage-summary
path: ./tests/coverage-unit-lcov/coverage-summary.json
if-no-files-found: error
retention-days: 7
- name: Upload unit-test-coverage-summary (current)
if: ${{ inputs.runner_provider != 'namespace' }}
uses: actions/upload-artifact@v4
with:
name: unit-test-coverage-summary
path: ./tests/coverage-unit-lcov/coverage-summary.json
Expand Down Expand Up @@ -817,7 +910,17 @@ jobs:
cp tests/results/cv-test-results-${{ matrix.shard }}.json ./tests/coverage/jest-results.json
count=$(jq '(.numPassedTests // 0) + (.numFailedTests // 0)' tests/results/cv-test-results-${{ matrix.shard }}.json)
echo "{\"count\": $count}" > ./tests/coverage/count.json
- uses: actions/upload-artifact@v4
- name: Upload coverage CV shard (Namespace)
if: ${{ inputs.runner_provider == 'namespace' }}
uses: namespace-actions/upload-artifact@f6ccaacc655aec41b93af180d1d7eef21af862d2 # v1.0.3
with:
name: coverage-cv-${{ matrix.shard }}
path: ./tests/coverage/
if-no-files-found: error
retention-days: 7
- name: Upload coverage CV shard (current)
if: ${{ inputs.runner_provider != 'namespace' }}
uses: actions/upload-artifact@v4
with:
name: coverage-cv-${{ matrix.shard }}
path: ./tests/coverage/
Expand Down Expand Up @@ -990,7 +1093,15 @@ jobs:
- uses: actions/checkout@v6
if: ${{ inputs.runner_provider != 'namespace' }}

- name: Download fixture validation results
- name: Download fixture validation results (Namespace)
if: ${{ inputs.runner_provider == 'namespace' }}
continue-on-error: true
uses: namespace-actions/download-artifact@7cbad919e4b0e09f17e9d6311a444ff002992b5b # v2.0.1
with:
name: test-e2e-main-validate-e2e-fixtures-junit-results
path: fixture-results/
- name: Download fixture validation results (current)
if: ${{ inputs.runner_provider != 'namespace' }}
continue-on-error: true
uses: actions/download-artifact@v4
with:
Expand Down Expand Up @@ -1033,7 +1144,15 @@ jobs:
- uses: actions/setup-node@v6
with:
node-version-file: '.nvmrc'
- uses: actions/download-artifact@v4
- name: Download lcov.info (Namespace)
if: ${{ inputs.runner_provider == 'namespace' }}
uses: namespace-actions/download-artifact@7cbad919e4b0e09f17e9d6311a444ff002992b5b # v2.0.1
with:
name: lcov.info
path: coverage/
- name: Download lcov.info (current)
if: ${{ inputs.runner_provider != 'namespace' }}
uses: actions/download-artifact@v4
with:
name: lcov.info
path: coverage/
Expand Down
Loading
Loading