Skip to content

ci: build iOS on macOS only when a pull request can affect it - #21

Merged
ardmn merged 2 commits into
mainfrom
agent/ci-skip-ios-when-irrelevant
Nov 25, 2026
Merged

ardmn merged 2 commits into
mainfrom
agent/ci-skip-ios-when-irrelevant

Conversation

@ardmn

@ardmn ardmn commented Nov 25, 2026 •

Copy link
Copy Markdown
Owner

Fixes ardmn/work#78 (the RN part).

GitHub's macOS arm64 runners are scarce: build-ios was 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 changes job decides, for pull requests only, whether the change can affect the iOS build (scripts/ios-affected.ts). build-ios is skipped only when every changed file is top-level Markdown, docs/, the Android modules, the Kotlin converter in tools/, 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; only DocumentLoader is 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 of ios/ and an iOS edit build), the CLI's GITHUB_OUTPUT, and a guard that no tracked file covered by turbo's build:ios inputs 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

  • Chores
    • iOS build checks now skip changes limited to documentation, Android, or unrelated tooling, while still running for changes that may affect the iOS build.
    • iOS build checks continue to run when the change range cannot be determined.

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.
@coderabbitai

coderabbitai Bot commented Nov 25, 2026 •

Copy link
Copy Markdown

Explain Change →

No actionable comments were generated in the recent review.

Walkthrough

Changes: Conditional iOS CI

Layer / File(s) Summary
iOS change detection
scripts/ios-affected.ts, scripts/__tests__/ios-affected.test.ts
The script classifies paths and retrieves changed files from a Git commit range. Tests cover irrelevant and relevant paths, empty changes, moved files, and unknown base revisions.
CLI output and CI gating
scripts/ios-affected.ts, scripts/__tests__/ios-affected.test.ts, .github/workflows/ci.yml
The CLI prints the decision and writes it to GITHUB_OUTPUT when that variable is set. The workflow uses the output to gate the iOS build job. Tests check CLI output for known and unknown ranges.

Change: Other

Merge Risk: Minimal · up to 43bf5

This change skips the iOS build only for pull requests whose changed files cannot affect it. Unknown or unusual cases still build iOS. No merge-blocking risk was identified.

Security architecture risk: Low · up to 43bf5

Pull requests can now pass without running the iOS build. Main and merge-queue runs still request it, but the release check does not distinguish a run that built iOS from one that skipped it. The new prerequisite also means a Linux setup failure can prevent the macOS job from starting.

Retained concerns

  • Medium · security · inferred: Release admission checks workflow success, not iOS job success. Before this PR, the CI workflow scheduled iOS on PR runs too. If the release query returns a successful PR run for the tagged SHA, that run can now satisfy the gate even though iOS was skipped and no main run has successfully verified it. The source does not establish that the same-SHA condition occurs under the hosted merge and tag policy.
  • Low · reliability · observed: Main and merge-queue runs do not need path classification, but the new dependency makes them wait for an Ubuntu runner, a full-history checkout, and Node setup before macOS can start. A failure or timeout in that setup now suppresses iOS verification on those events. The affected CI run fails rather than silently passing.
Security review details

Security Blast Radius

  • inferred — The changed control affects repository CI and the evidence used to approve this package's publication. The classifier job has no publish authority; publication remains in the separately permissioned tag workflow.

Trust Boundaries and Controls

  • observed — The classifier runs against PR checkout content on pull_request, not pull_request_target. Its job inherits contents: read, does not persist checkout credentials, and passes revision arguments to Git without a shell.

Hardening Proposals

  • proposed — Make the release gate require a successful main CI run for the tagged SHA with a successful, non-skipped build-ios job, instead of treating any successful workflow run as equivalent.
  • proposed — Keep main and merge-queue iOS execution independent of the PR classifier so a failure to start or prepare the Linux job cannot stop verification on those events.
Finishing Touches

Generate unit tests (beta)

  • Commit to this branch
  • Create a new PR
Fix failing CI checks

  • Commit to this branch
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
Recent review info

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: de7998c7-2c50-442a-9add-88a5e70b0257
Commits

Reviewing files that changed from the base of the PR and between 64b48b1 and 43bf57b.

Files selected for processing: 3

  • .github/workflows/ci.yml
  • scripts/__tests__/ios-affected.test.ts
  • scripts/ios-affected.ts

Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 9 remain after this review.

@ardmn
ardmn merged commit cf31391 into main Nov 25, 2026
16 of 17 checks passed
@ardmn
ardmn deleted the agent/ci-skip-ios-when-irrelevant branch November 25, 2026 21:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant