Skip to content

Commit 32be6ef

Browse files
committed
ci: narrow dorny diff to current push + drop oversized peer caches
Two issues compounded into bare-rn rebuilding on a CV-only push: 1. dorny defaulted to comparing against the PR base, so each push re-evaluated the cumulative PR diff and pulled every app whose filter ever matched into the matrix. Setting `base: event.before || pull_request.base.sha` restricts the diff to just the current push (with PR-base fallback for opened / reopened / ready_for_review). 2. The Gradle (~3 GB) and CocoaPods (~500 MB × 5 iOS apps) caches saved during a single run, plus setup-java's redundant gradle cache, pushed the repo over GitHub's 10 GB cache quota and evicted the tiny (~250 B) build markers under LRU. Cells appeared in the matrix on subsequent pushes (legitimately, per PR-base diff) but missed the cache and rebuilt. Dropping these peer caches so markers survive — markers gate entire build cells, which is worth more than the 3-10 min those caches saved on warm-up.
1 parent edf42ab commit 32be6ef

3 files changed

Lines changed: 14 additions & 24 deletions

File tree

.github/actions/build-android-app/action.yml

Lines changed: 4 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,6 @@ runs:
6565
with:
6666
distribution: "zulu"
6767
java-version: 17
68-
cache: "gradle"
6968

7069
- name: Install Expo CLI
7170
if: steps.cache.outputs.cache-hit != 'true' && inputs.expo-prebuild == 'true'
@@ -82,18 +81,10 @@ runs:
8281
rm -rf android
8382
npx expo prebuild --platform android --no-install
8483
85-
- name: Cache Gradle
86-
if: steps.cache.outputs.cache-hit != 'true'
87-
uses: actions/cache@v5
88-
with:
89-
path: |
90-
~/.gradle/caches
91-
~/.gradle/wrapper
92-
${{ inputs.app-path }}/android/.gradle
93-
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }}
94-
restore-keys: |
95-
${{ runner.os }}-gradle-
96-
84+
# Note: not caching ~/.gradle or apps/<app>/android/.gradle on purpose.
85+
# A full Gradle cache for this monorepo runs ~3 GB and competes with the
86+
# 10 GB repo cache quota against the much smaller (~250 B) build markers.
87+
# Markers gating entire build cells beat ~5-10 min of Gradle warm-up.
9788
- name: Build app
9889
if: steps.cache.outputs.cache-hit != 'true'
9990
working-directory: ${{ inputs.app-path }}/android

.github/actions/build-ios-app/action.yml

Lines changed: 4 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -67,17 +67,10 @@ runs:
6767
rm -rf ios
6868
npx expo prebuild --platform ios --no-install
6969
70-
- name: Cache CocoaPods
71-
if: steps.cache.outputs.cache-hit != 'true'
72-
uses: actions/cache@v5
73-
with:
74-
path: |
75-
~/Library/Caches/CocoaPods
76-
${{ inputs.app-path }}/ios/Pods
77-
key: ${{ runner.os }}-pods-${{ inputs.filter-name }}-${{ hashFiles(format('{0}/ios/Podfile.lock', inputs.app-path)) }}
78-
restore-keys: |
79-
${{ runner.os }}-pods-${{ inputs.filter-name }}-
80-
70+
# Note: not caching CocoaPods on purpose. A populated Pods/ runs ~500 MB
71+
# per app — ~2.5 GB across the 5 iOS cells — and competes with the 10 GB
72+
# repo cache quota against the much smaller (~250 B) build markers.
73+
# Markers gating entire build cells beat ~3-5 min of pod-install warm-up.
8174
- name: Install CocoaPods dependencies
8275
if: steps.cache.outputs.cache-hit != 'true'
8376
working-directory: ${{ inputs.app-path }}/ios

.github/workflows/build-apps.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,12 @@ jobs:
3030
if: github.event_name != 'workflow_dispatch'
3131
uses: dorny/paths-filter@v3
3232
with:
33+
# Diff against the previous commit (synchronize/push) or the PR base
34+
# (opened/reopened/ready_for_review). Without this, dorny defaults to
35+
# the PR base on every push, so each commit re-evaluates the
36+
# cumulative PR diff and pulls every app whose filter ever matched
37+
# into the matrix — even when the latest push only touched one app.
38+
base: ${{ github.event.before || github.event.pull_request.base.sha }}
3339
filters: |
3440
# Cross-platform shared infrastructure
3541
core-shared: &core-shared

0 commit comments

Comments
 (0)