[PR #6583] [PM-32758] ci: Improve CI cache to fix GitHub runners running out of memory #12838

Closed
opened 2026-04-11 03:52:07 -05:00 by GiteaMirror · 0 comments
Owner

Original Pull Request: https://github.com/bitwarden/android/pull/6583

State: closed
Merged: Yes


🎟️ Tracking

PM-32758

📔 Objective

Fix GitHub runners running out of memory by replacing our cache approach with setup-gradle action. This action comes with a sensible set of default settings following best practices, worth nothing:

  • Cache cleanup
  • Restricted write - defaults to main branches only, mitigating cache poisoning and useful caches from main being replaced by feature branch caches that aren't useful for others, slowing down all runs.

While at it:

  1. Consolidated everything into our setup-andoid-build reusable action
  2. Removed local build-cache path override from settings.gradle.kts. Gradle's default cache location is used instead.
  3. Increased Gradle heap size from 4g to 6g based on the Post setup-gradle action logs, mentioning "cache misses" due to low memory. Test runs - before | after
  4. Test workflow was updated to run on release branches in addition to main.

Test Runs (forced to write cache):

**Original Pull Request:** https://github.com/bitwarden/android/pull/6583 **State:** closed **Merged:** Yes --- ## 🎟️ Tracking PM-32758 ## 📔 Objective Fix GitHub runners running out of memory by replacing our cache approach with `setup-gradle` action. This action comes with a sensible set of default settings following best practices, worth nothing: * [Cache cleanup](https://github.com/gradle/actions/blob/main/docs/setup-gradle.md#configuring-cache-cleanup) * [Restricted write](https://github.com/gradle/actions/blob/main/docs/setup-gradle.md#select-which-branches-should-write-to-the-cache) - defaults to `main` branches only, mitigating cache poisoning and useful caches from `main` being replaced by feature branch caches that aren't useful for others, slowing down all runs. While at it: 1. Consolidated everything into our `setup-andoid-build` reusable action 2. Removed local build-cache path override from settings.gradle.kts. Gradle's default cache location is used instead. 3. Increased Gradle heap size from 4g to 6g based on the Post `setup-gradle` action logs, mentioning "cache misses" due to low memory. Test runs - [before](https://github.com/bitwarden/android/actions/runs/22367538659/job/64737475122) | [after](https://github.com/bitwarden/android/actions/runs/22405671990/job/64864713540) 4. Test workflow was updated to run on release branches in addition to main. Test Runs (forced to write cache): * [build-testharness.yml](https://github.com/bitwarden/android/actions/runs/22405671990/job/64864713540) * [build.yml](https://github.com/bitwarden/android/actions/runs/22411262441) * [build-authenticator.yml](https://github.com/bitwarden/android/actions/runs/22411270020) * [test.yml](https://github.com/bitwarden/android/actions/runs/22412907340/job/64890898693)
GiteaMirror added the pull-request label 2026-04-11 03:52:07 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/android#12838