Skip to content

Commit dbb8737

Browse files
committed
ci: bare-rn bundle prep, Pods cache, exclude workflow file from build hash
- bundle job now runs `yarn prepare` before bundling bare-rn so react-native-executorch-bare-resource-fetcher's lib/ exists for metro (Expo apps don't need it; expo export resolves workspace deps directly). - iOS composite caches CocoaPods recipes + installed Pods keyed by Podfile.lock, saving ~3-5 min per cell on cache hits. - compute-app-hash.js excludes .github/workflows/build-apps.yml from the content hash. Workflow edits still trigger the matrix, but each cell hits its existing marker and skips. Build-behavior workflow edits (with:, runs-on:, env:) need a manual cache clear via the UI.
1 parent 9aef7d0 commit dbb8737

3 files changed

Lines changed: 32 additions & 1 deletion

File tree

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

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,17 @@ 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@v4
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+
7081
- name: Install CocoaPods dependencies
7182
if: steps.cache.outputs.cache-hit != 'true'
7283
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
@@ -172,6 +172,12 @@ jobs:
172172
- name: Skip notice
173173
if: steps.cache.outputs.cache-hit == 'true'
174174
run: echo "Skipping bundle — bundle-${{ matrix.platform }}-${{ matrix.app }} already passed at this content hash."
175+
- name: Build workspace packages
176+
if: steps.cache.outputs.cache-hit != 'true' && matrix.app == 'bare-rn'
177+
run: yarn workspaces foreach --all --topological-dev run prepare
178+
- name: Build workspace packages
179+
if: steps.cache.outputs.cache-hit != 'true' && matrix.app == 'bare-rn'
180+
run: yarn workspaces foreach --all --topological-dev run prepare
175181
- name: Bundle JS for ${{ matrix.platform }}
176182
if: steps.cache.outputs.cache-hit != 'true'
177183
working-directory: apps/${{ matrix.app }}

scripts/compute-app-hash.js

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,18 @@ const crypto = require('crypto');
1010
const yaml = require('js-yaml');
1111
const picomatch = require('picomatch');
1212

13+
// Files that the per-app filters reference for trigger purposes but that
14+
// should not invalidate cached build markers. The workflow file itself sits in
15+
// core-shared so editing it triggers CI on every app, but the vast majority of
16+
// edits are orchestration (filter paths, matrix shape, concurrency, triggers)
17+
// and don't change build behavior. Excluding it from the hash means workflow
18+
// edits re-run the matrix but each cell hits its existing marker and skips.
19+
//
20+
// Caveat: workflow edits that DO change build behavior — `with:` inputs to a
21+
// composite, `runs-on:`, an `env:` var, an action's pinned version — won't be
22+
// caught here. Force-clear caches via the GitHub Actions UI when you make one.
23+
const HASH_EXCLUDE = new Set(['.github/workflows/build-apps.yml']);
24+
1325
const filterName = process.argv[2];
1426
if (!filterName) {
1527
console.error('Usage: compute-app-hash.js <filter-name>');
@@ -44,7 +56,9 @@ const lines = cp
4456
.split('\n')
4557
.filter((line) => {
4658
const tabIdx = line.indexOf('\t');
47-
return tabIdx !== -1 && matchAny(line.slice(tabIdx + 1));
59+
if (tabIdx === -1) return false;
60+
const path = line.slice(tabIdx + 1);
61+
return !HASH_EXCLUDE.has(path) && matchAny(path);
4862
})
4963
.sort();
5064

0 commit comments

Comments
 (0)