ci: per-app build matrix with precise path triggers#1112
Conversation
Replaces the LLM-only Android/iOS build workflows with one matrix-based workflow per platform that gates each app's build on `dorny/paths-filter`. Adds coverage for computer-vision, speech, text-embeddings, and bare-rn demos, plus a Jest smoke test for bare-rn. Skips builds on draft PRs and fires on ready_for_review so flipping a draft to ready triggers CI. Closes #963.
| computer-vision: | ||
| - *expo-shared | ||
| - packages/react-native-executorch/common/rnexecutorch/models/VisionModel.{cpp,h} | ||
| - packages/react-native-executorch/common/rnexecutorch/models/{classification,instance_segmentation,object_detection,ocr,semantic_segmentation,style_transfer,text_to_image,vertical_ocr}/** |
There was a problem hiding this comment.
these and speech models should be gathered is a separate PR to separate subdirs to exclude this too long inclusion lines.
… 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.
Pull_request runs scope caches to refs/pull/N/merge, which gets dereferenced when the PR is closed. Switch to a push-driven trigger so caches save against refs/heads/<branch> and survive close/reopen. - push: branches ['**'] covers every commit to every branch. - pull_request: types narrowed to [opened, reopened, ready_for_review] — the events with no corresponding push. - pull_request: synchronize removed (push already covers every commit). - Workflow-level concurrency keyed by event_name + branch so push and pull_request runs don't cancel each other. - Draft status resolved via `gh pr list` for push events, preserving the no-CI-on-drafts rule from #963 even without a pull_request payload.
… wipe them" This reverts commit 0dd4cba.
There was a problem hiding this comment.
I've tested the CI on a forked repo (barhanc#2) following the instructions and it seems to me that there is some problem with caching:
- after pushing changes to
apps/computer-vision/**for some reason the Android bare-rn app is not skipped and its build runs (in addition to computer-vision apps), see here: https://github.com/barhanc/react-native-executorch/actions/runs/25800750822/job/75789861221 - pushing an added comment to
.github/workflows/build-apps.ymlrebuilds all iOS apps, but skips Android, e.g.:
The two following commits (broken import and a file not matched by any filter) behave correctly.
Ok, will investigate it. |
|
|
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.
|
@barhanc I changed approach to how diffs are resolved, please could you check again later? |
chmjkb
left a comment
There was a problem hiding this comment.
not sure if i have anything to add here regarding the code, but I think it would be nice to have some kind of readme that explains what is going on here and when what needs to be changed
also I'd like to hear what @mkopcins has to say before we merge
Agreed, some kind of readme will be helpful for this one. |
Description
Replaces the LLM-only build workflows with one matrix-based
build-apps.yml, gated bydorny/paths-filterso each app/platform cell runs only when its code or shared infrastructure changes.Three parallel matrices per push:
Cells skip in ~30s via content-hash cache markers when their relevant files haven't changed since the last passing run.
A lint-time drift check fails PRs that introduce source files not covered by any per-app filter.
Adds a Jest smoke test for bare-rn.
Skips all build workflows on draft PRs; fires on
ready_for_review.Introduces a breaking change?
Type of change
Tested on
Not applicable
Testing instructions
Example apps build checkruns; the matrix contains only the apps whose paths actually changed.apps/computer-vision/**— onlycomputer-visioncells run (Android + iOS + bundle).packages/react-native-executorch/android/**— only Android native cells run; iOS and bundle skip.App.tsx— the bundle cell for that app fails fast before any native build finishes.packages/react-native-executorch/not matched by any filter —Check CI filter coveragein thelintjob fails and lists the uncovered path.Related issues
Closes #963.
Checklist
Additional notes
This PR also fixes notorious iOS CI fails but getting available simulator, not a specific one.