@@ -448,110 +448,6 @@ jobs:
448448 run : ${{ steps.download-actionlint.outputs.executable }} -color -config-file .github/actionlint.yaml
449449 shell : bash
450450
451- android-lint :
452- name : Android lint
453- runs-on : ghcr.io/cirruslabs/ubuntu-runner-amd64:24.04-lg
454- timeout-minutes : 45
455- if : >-
456- ${{
457- needs.get_requirements.outputs.skip_everything != 'true' &&
458- !(github.event_name == 'pull_request' && github.event.pull_request.head.repo.fork)
459- }}
460- needs :
461- - get_requirements
462- permissions :
463- contents : read
464- id-token : write
465- env :
466- GRADLE_USER_HOME : /home/admin/_work/.gradle
467- steps :
468- - uses : actions/checkout@v6
469-
470- - name : Restore .metamask folder
471- uses : actions/cache@v4
472- with :
473- path : .metamask
474- key : .metamask-${{ hashFiles('package.json', 'yarn.lock') }}
475-
476- - name : Setup Android build environment
477- timeout-minutes : 15
478- uses : ./.github/actions/setup-e2e-env
479- with :
480- platform : android
481- setup-simulator : false
482- configure-keystores : true
483- android-api-level : 36
484- target : qa
485-
486- # React Native is an includeBuild() with its own settings root; cap ABI + Gradle there so the
487- # composite build does not default to all ABIs or ignore android/gradle.properties.
488- - name : Tune included React Native build for CI memory
489- run : |
490- set -euo pipefail
491- RN_GP="node_modules/react-native/gradle.properties"
492- if ! grep -qF '# metamask-mobile android-lint CI' "$RN_GP"; then
493- {
494- echo ''
495- echo '# metamask-mobile android-lint CI'
496- echo 'reactNativeArchitectures=x86_64'
497- echo 'org.gradle.parallel=false'
498- echo 'org.gradle.workers.max=1'
499- echo 'org.gradle.jvmargs=-Xmx4096m -XX:MaxMetaspaceSize=1024m -XX:+UseG1GC -XX:+ExitOnOutOfMemoryError -Dfile.encoding=UTF-8'
500- echo 'kotlin.daemon.jvmargs=-Xmx512m -XX:+UseG1GC -XX:+ExitOnOutOfMemoryError'
501- } >> "$RN_GP"
502- fi
503-
504- - name : Restore Gradle dependencies
505- uses : cirruslabs/cache@bba69c6578b863ad0398ad40567bd2ef70290fe0 # v4
506- env :
507- GRADLE_LINT_CACHE_VERSION : 1
508- with :
509- path : |
510- /home/admin/_work/.gradle/caches
511- /home/admin/_work/.gradle/wrapper
512- key : android-lint-gradle-${{ env.GRADLE_LINT_CACHE_VERSION }}-${{ runner.os }}-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }}
513-
514- - name : Setup project dependencies with retry
515- uses : nick-fields/retry@ce71cc2ab81d554ebbe88c79ab5975992d79ba08 # v3.0.2
516- with :
517- timeout_minutes : 10
518- max_attempts : 3
519- retry_wait_seconds : 30
520- command : yarn setup:github-ci --no-build-ios
521-
522- - name : Run Android lint (prodRelease)
523- working-directory : android
524- env :
525- NODE_OPTIONS : --max-old-space-size=4096
526- # ReactAndroid CMake invokes Ninja with high parallelism by default; cap native compile RAM.
527- CMAKE_BUILD_PARALLEL_LEVEL : 1
528- NINJAFLAGS : -j1
529- run : |
530- set -euo pipefail
531- cp gradle.properties.github gradle.properties
532- # github file targets 48GB runners; shrink JVM + workers on smaller self-hosted runners.
533- sed -i \
534- -e 's/^org.gradle.parallel=.*/org.gradle.parallel=false/' \
535- -e 's/^org.gradle.workers.max=.*/org.gradle.workers.max=1/' \
536- -e 's/^org.gradle.jvmargs=.*/org.gradle.jvmargs=-Xmx4096m -XX:MaxMetaspaceSize=1024m -XX:+UseG1GC -XX:+ExitOnOutOfMemoryError -Dfile.encoding=UTF-8/' \
537- -e 's/^kotlin.daemon.jvmargs=.*/kotlin.daemon.jvmargs=-Xmx512m -XX:+UseG1GC -XX:+ExitOnOutOfMemoryError/' \
538- gradle.properties
539- ./gradlew --stop || true
540- SENTRY_DISABLE_AUTO_UPLOAD=true ./gradlew :app:lintProdRelease \
541- -PreactNativeArchitectures=x86_64 \
542- --max-workers=1 \
543- --no-daemon
544-
545- - name : Require clean working directory
546- shell : bash
547- run : |
548- if ! git diff --exit-code; then
549- echo "Working tree dirty at end of job"
550- exit 1
551- else
552- echo "No changes detected"
553- fi
554-
555451 unit-tests :
556452 name : Unit tests (${{ matrix.shard }})
557453 runs-on : ubuntu-latest
@@ -831,6 +727,7 @@ jobs:
831727 uses : ./.github/workflows/build-android-e2e.yml
832728 with :
833729 build_type : ' main'
730+ run_android_lint : true
834731 metamask_environment : ' e2e'
835732 keystore_target : ' qa'
836733 secrets : inherit
@@ -1053,7 +950,6 @@ jobs:
1053950 unit-tests,
1054951 component-view-tests,
1055952 check-workflows,
1056- android-lint,
1057953 js-bundle-size-check,
1058954 sonar-cloud-quality-gate-status,
1059955 ]
0 commit comments