Skip to content

feat: Gradle optimization for Android production builds#29836

Merged
Qbandev merged 4 commits into
mainfrom
feat/mcwp-574-gradle-optimization
May 8, 2026
Merged

feat: Gradle optimization for Android production builds#29836
Qbandev merged 4 commits into
mainfrom
feat/mcwp-574-gradle-optimization

Conversation

@Qbandev

@Qbandev Qbandev commented May 7, 2026

Copy link
Copy Markdown
Contributor

Description

The Android production build in build.yml runs Gradle without build caching, parallelism, or optimized JVM settings. The E2E builds already use an optimized gradle.properties.github with all these features, plus they cache Gradle dependencies across runs via cirruslabs/cache@v4. None of these optimizations exist in the production build path.

This PR brings parity by:

  1. Creating android/gradle.properties.release adapted from the E2E config (keeps all 4 architectures for Play Store, disables Gradle daemon for ephemeral CI)
  2. Adding GRADLE_USER_HOME and CACHE_GENERATION env vars to the build job (matching E2E pattern)
  3. Adding a cp step to apply the release config before the build
  4. Adding cirruslabs/cache@v4 steps for Gradle dependency caching with branch-scoped keys and main fallback

Part of MCWP-574 (PR 4 of 5).

Changelog

CHANGELOG entry: null

Related issues

Fixes: MCWP-574

Manual testing steps

Feature: Gradle optimization for Android production builds

  Scenario: First build populates Gradle cache
    Given a production Android build is triggered via workflow_dispatch on build.yml
    When the build job runs with the new Gradle config
    Then the "Restore Gradle dependencies from branch cache" step shows cache MISS
    And the build completes successfully with APK and AAB artifacts
    And the Gradle build uses parallel execution and 8GB JVM heap

  Scenario: Subsequent build uses Gradle cache
    Given a previous Android production build has completed successfully
    When a new Android production build is triggered
    Then the "Restore Gradle dependencies from branch cache" step shows cache HIT
    And Gradle dependency resolution completes faster than the first run
    And the total build duration is reduced

Screenshots/Recordings

N/A - CI pipeline change, no UI impact.

Pre-merge author checklist

Pre-merge reviewer checklist

  • I've manually tested the PR (e.g. pull and build branch, run the app, test code being changed).
  • 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.

- Create gradle.properties.release with parallel builds, build
  caching, 8GB JVM heap, and all 4 architectures for Play Store
- Copy release config over default gradle.properties before build
- Cache Gradle dependencies via cirruslabs/cache with branch-scoped
  keys and read-only fallback from main
- Set GRADLE_USER_HOME for Cirrus runner compatibility

Ref: MCWP-574
@github-actions

github-actions Bot commented May 7, 2026

Copy link
Copy Markdown
Contributor

CLA Signature Action: All authors have signed the CLA. You may need to manually re-run the blocking PR check if it doesn't pass in a few minutes.

@metamaskbotv2 metamaskbotv2 Bot added the team-dev-ops DevOps team label May 7, 2026
@github-actions github-actions Bot added the size-S label May 7, 2026
@Qbandev Qbandev added the no-changelog no-changelog Indicates no external facing user changes, therefore no changelog documentation needed label May 7, 2026
@Qbandev Qbandev added Code Impact - Medium Average task code change that can relatively safely being applied to the codebase and removed Code Impact - Medium Average task code change that can relatively safely being applied to the codebase labels May 7, 2026
@Qbandev Qbandev marked this pull request as ready for review May 7, 2026 07:31
@Qbandev Qbandev requested a review from a team as a code owner May 7, 2026 07:31
@jvbriones jvbriones added the skip-smart-e2e-selection Skip Smart E2E selection, i.e. select all E2E tests to run label May 7, 2026
@github-actions

github-actions Bot commented May 7, 2026

Copy link
Copy Markdown
Contributor

🔍 Smart E2E Test Selection

⏭️ Smart E2E selection skipped - skip-smart-e2e-selection label found

All E2E tests pre-selected.

View GitHub Actions results

@sonarqubecloud

sonarqubecloud Bot commented May 7, 2026

Copy link
Copy Markdown

@Qbandev Qbandev added the Code Impact - Low Minor code change that can safely applied to the codebase label May 7, 2026
@Qbandev Qbandev added this pull request to the merge queue May 8, 2026
Merged via the queue into main with commit a732da4 May 8, 2026
204 of 206 checks passed
@Qbandev Qbandev deleted the feat/mcwp-574-gradle-optimization branch May 8, 2026 13:59
@github-actions github-actions Bot locked and limited conversation to collaborators May 8, 2026
@metamaskbotv2 metamaskbotv2 Bot added the release-7.78.0 Issue or pull request that will be included in release 7.78.0 label May 8, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

Code Impact - Low Minor code change that can safely applied to the codebase no-changelog no-changelog Indicates no external facing user changes, therefore no changelog documentation needed release-7.78.0 Issue or pull request that will be included in release 7.78.0 size-S skip-smart-e2e-selection Skip Smart E2E selection, i.e. select all E2E tests to run team-dev-ops DevOps team

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants