mirror of
https://github.com/block/buzz.git
synced 2026-11-24 10:12:19 +00:00
## 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>
34 lines
925 B
JavaScript
34 lines
925 B
JavaScript
import assert from "node:assert/strict";
|
|
import { appendFileSync, readFileSync } from "node:fs";
|
|
|
|
const filters = JSON.parse(process.env.FILTER_OUTPUTS);
|
|
let runAll = false;
|
|
if (process.env.GITHUB_EVENT_NAME === "pull_request") {
|
|
const event = JSON.parse(readFileSync(process.env.GITHUB_EVENT_PATH, "utf8"));
|
|
const count = event.pull_request.changed_files;
|
|
assert.ok(
|
|
Number.isSafeInteger(count) && count >= 0,
|
|
"Invalid PR changed_files",
|
|
);
|
|
// GitHub's PR-files endpoint returns at most 3,000 files. Never use a
|
|
// potentially incomplete list to skip a runtime suite.
|
|
runAll = count >= 3000;
|
|
}
|
|
for (const key of [
|
|
"rust",
|
|
"desktop",
|
|
"desktop-rust",
|
|
"web",
|
|
"mobile",
|
|
"mobile-native",
|
|
]) {
|
|
assert.ok(
|
|
["true", "false"].includes(filters[key]),
|
|
`Invalid ${key} selection`,
|
|
);
|
|
appendFileSync(
|
|
process.env.GITHUB_OUTPUT,
|
|
`${key}=${runAll ? "true" : filters[key]}\n`,
|
|
);
|
|
}
|