ci(mobile): run the Mobile Swift Native lane only for native changes (#9847)

## What changes

The Mobile Swift Native job rebuilds the iOS simulator app from scratch.
On the run in #9809, `xcodebuild build-for-testing` took about 19
minutes and RunnerTests took about a minute. That PR changed the pubspec
files, so it would select Native under this filter.

For PRs, select Native for changes to `mobile/ios/`, `mobile/packages/`,
`mobile/assets/`, `mobile/scripts/`, the pubspec files, the Flutter SDK
pin, the four native test scripts, or either CI workflow that configures
it. Changes to the SDK pin or the four native test scripts also select
mobile CI. At GitHub’s 3,000-file listing limit, the selector runs all
suites.

When a PR selects mobile CI and touches none of the Native paths, Mobile
Swift runs the unsigned iOS release build and skips the debug simulator
build and its Apple Silicon linking check (#7646). Dart-only and
Android-only mobile PRs are examples.

Pushes to `main` and `release` run both Swift lanes whenever mobile CI
is selected. A RunnerTest starts the normal Dart entry point in a
Flutter engine. A Dart change that passes PR checks can therefore fail a
simulator test on the merge commit.

## Validation

- The local CI selection suite passed against the pinned
`dorny/paths-filter` action with 83 passes and eight Linux-only skips.
The required-context isolation contract also passed.
- GitHub scheduled both Swift lanes on the initial revision `a34746e6`.
Native passed in 14m35s and Release passed in 6m24s. [CI
run](https://github.com/block/buzz/actions/runs/44863694135)
- To verify hosted Release-only scheduling after merge, check the next
mobile PR that changes none of the Native paths. Mobile Swift should
show Release only, and the required Mobile check should report its
result.

---------

Signed-off-by: Wes <wesb@block.xyz>
Co-authored-by: Gamora <a0291282695a734997579812cc077d006bd2c5a73855019e537a0cddd46887c1@buzz.block.builderlab.xyz>
This commit is contained in:
Wes
2026-11-21 16:41:55 -07:00
committed by GitHub
parent 80131055dc
commit 0e7fd48d41
4 changed files with 102 additions and 12 deletions

View File

@@ -29,6 +29,7 @@ jobs:
desktop-rust: ${{ steps.selection.outputs.desktop-rust }}
web: ${{ steps.selection.outputs.web }}
mobile: ${{ steps.selection.outputs.mobile }}
mobile-native: ${{ steps.selection.outputs.mobile-native }}
steps:
- uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3
with:
@@ -100,8 +101,15 @@ jobs:
- 'pnpm-lock.yaml'
mobile:
- 'mobile/**'
- 'bin/flutter'
- 'bin/dart'
- 'bin/.flutter-*.pkg'
- 'Justfile'
- 'scripts/test-mobile-gateway-recipes.sh'
- 'scripts/test-mobile-pagination.sh'
- 'scripts/test-mobile-pagination-accessibility.sh'
- 'scripts/test-mobile-carousel.sh'
- 'scripts/test-mobile-member-picker.sh'
- 'scripts/mobile-release.sh'
- 'scripts/mobile-release-source.sh'
- 'scripts/mobile-worktree-overrides.sh'
@@ -112,6 +120,27 @@ jobs:
- 'scripts/ci-hermit-retry.sh'
- '.github/workflows/ci.yml'
- '.github/workflows/_ci-*.yml'
# What the Mobile Swift Native lane compiles and runs. Dart-only
# changes skip its simulator build; the Release lane still builds
# iOS for every mobile change.
mobile-native:
- 'mobile/ios/**'
- 'mobile/packages/**'
# Native code loads fonts and emoji data from the Flutter asset
# bundle, and the Xcode build runs a script from mobile/scripts.
- 'mobile/assets/**'
- 'mobile/scripts/**'
- 'mobile/pubspec.yaml'
- 'mobile/pubspec.lock'
- 'bin/flutter'
- 'bin/dart'
- 'bin/.flutter-*.pkg'
- 'scripts/test-mobile-pagination.sh'
- 'scripts/test-mobile-pagination-accessibility.sh'
- 'scripts/test-mobile-carousel.sh'
- 'scripts/test-mobile-member-picker.sh'
- '.github/workflows/ci.yml'
- '.github/workflows/_ci-clients.yml'
- name: Select runtime suites conservatively at the PR file-list limit
id: selection
env:
@@ -267,6 +296,10 @@ jobs:
with:
web: ${{ needs.changes.outputs.web == 'true' }}
mobile: ${{ needs.changes.outputs.mobile == 'true' }}
# Pull requests skip the Native lane for changes outside its paths. A
# push still runs it for every mobile change, so a Dart change that
# breaks a native test fails on its own commit.
mobile_native: ${{ github.event_name == 'push' || needs.changes.outputs.mobile-native == 'true' }}
lane: mobile-swift
# Advisory flake check: repeats the tests a pull request changes. Its lanes