Skip to content

ci: per-app build matrix with precise path triggers#1112

Open
msluszniak wants to merge 10 commits intomainfrom
@ms/ci-coverage
Open

ci: per-app build matrix with precise path triggers#1112
msluszniak wants to merge 10 commits intomainfrom
@ms/ci-coverage

Conversation

@msluszniak
Copy link
Copy Markdown
Member

@msluszniak msluszniak commented Apr 29, 2026

Description

Replaces the LLM-only Android/iOS build workflows with one matrix-based build-apps.yml, gated by dorny/paths-filter so each app/platform cell runs only when its code or shared infrastructure changes. Three parallel matrices per push: a Metro JS bundle (production mode, catches missing imports and transform errors before any native build), Android native build, iOS native build. 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?

  • Yes
  • No

Type of change

  • Bug fix (change which fixes an issue)
  • New feature (change which adds functionality)
  • Documentation update (improves or adds clarity to existing documentation)
  • Other (chores, tests, code style improvements etc.)

Tested on

  • iOS
  • Android

Testing instructions

  1. Open as draft — confirm no build workflows run.
  2. Mark ready for review — Example apps build check runs; the matrix contains only the apps whose paths actually changed.
  3. Touch only apps/computer-vision/** — only computer-vision cells run (Android + iOS + bundle).
  4. Touch only packages/react-native-executorch/android/** — only Android native cells run; iOS and bundle skip.
  5. Push a no-op touching only the workflow file — every cell hits its cache marker and finishes in ~30s.
  6. Add a broken import to one app's App.tsx — the bundle cell for that app fails fast before any native build finishes.
  7. Add a tracked file under packages/react-native-executorch/ not matched by any filter — Check CI filter coverage in the lint job fails and lists the uncovered path.

Related issues

Closes #963.

Checklist

  • I have performed a self-review of my code
  • I have commented my code, particularly in hard-to-understand areas
  • I have updated the documentation accordingly
  • My changes generate no new warnings

Additional notes

Composite actions in .github/actions/build-{android,ios}-app/ carry the build steps; iOS auto-detects workspace and scheme. Beyond #963:

  • Metro production-bundle matrix catches missing imports / transform errors before any native build runs.
  • Content-hash cache markers (scripts/compute-app-hash.js) skip unchanged cells in ~30s; workflow file excluded so orchestration edits don't cascade-invalidate.
  • Drift check (scripts/check-ci-filter-coverage.js) wired into ci.yml lint fails PRs that introduce uncovered source files.
  • Single workflow + YAML anchors keep each path defined once across both platforms.
  • CocoaPods cache, draft skip on every PR workflow, paths-ignore for docs in ci.yml, apps/bare-rn/__mocks__/ for the Jest test, generic/platform=iOS Simulator to avoid flaky simulator lookups.

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.
@msluszniak msluszniak self-assigned this Apr 29, 2026
@msluszniak msluszniak added the chore PRs that are chores label Apr 29, 2026
@msluszniak msluszniak marked this pull request as draft April 29, 2026 16:41
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}/**
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

these and speech models should be gathered is a separate PR to separate subdirs to exclude this too long inclusion lines.

@msluszniak msluszniak marked this pull request as ready for review April 29, 2026 16:44
@msluszniak msluszniak marked this pull request as draft April 29, 2026 17:43
@msluszniak msluszniak marked this pull request as ready for review April 29, 2026 18:24
… 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.
@msluszniak msluszniak requested review from NorbertKlockiewicz and chmjkb and removed request for chmjkb April 29, 2026 20:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

chore PRs that are chores

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Create more CI jobs that are precisely triggered when needed

1 participant