Repository navigation
ci: build iOS on macOS only when a pull request can affect it - #21
Conversation
GitHub's macOS arm64 runners are scarce: build-ios was cancelled with "not acquired" on main and on Dependabot PRs. A Linux job now decides from the changed files: build-ios is skipped only when every file is documentation, Android, the Kotlin converter, e2e flows or bot config; anything else, an unknown range or the merge queue builds iOS. A skipped job does not fail the run, so the release gate is unchanged, and a release commit changes package.json and always builds. Decision: paths-ignore on the workflow would also skip the Linux gates; the existing turbo cache skip still allocates a macOS runner. A small Linux decision job keeps everything else as it is.
Review: a quick second push to main cancelled the first run and skipped its iOS change, main could show green over a broken iOS build, and the release gate could pass on a tag whose commit skipped iOS (v0.1.0 was such a tag). Pushes and the merge queue now always build. Also: renames count both paths (--no-renames), only top-level Markdown is skipped, and a test fails if any tracked turbo build:ios input would be skipped.
|
No actionable comments were generated in the recent review. Walkthrough
Change: Other Merge Risk:
|
Fixes ardmn/work#78 (the RN part).
GitHub's macOS arm64 runners are scarce:
build-ioswas cancelled with "not acquired" on main and on Dependabot PRs. Everything else in this CI already runs on Linux;build-ios(Xcode, CocoaPods, the Swift XCTest scheme) cannot.Change. A Linux
changesjob decides, for pull requests only, whether the change can affect the iOS build (scripts/ios-affected.ts).build-iosis skipped only when every changed file is top-level Markdown,docs/, the Android modules, the Kotlin converter intools/,e2e/flows or bot config; anything else, an unknown range or an empty diff builds. Renames count both paths. Every push to main and the merge queue always build iOS, so main's status, a run cancelled by a later push and the release gate never rest on a skipped build.Not moved to Linux: the Swift unit tests import
RcComposePlayerSwiftUI(SwiftUI/UIKit), so they need the Apple toolchain; onlyDocumentLoaderis pure Foundation, not worth a separate lane.Tests (
scripts/__tests__/ios-affected.test.ts): path rules incl. near misses, a real scratch-repo range (docs only skips; a file moved out ofios/and an iOS edit build), the CLI'sGITHUB_OUTPUT, and a guard that no tracked file covered by turbo'sbuild:iosinputs is ever skipped. Mutations (no--no-renames, unanchored.md) fail them. On history: PR #20 (README only) → skip; #19 (deps) and #18 (release) → build.Summary by CodeRabbit