55 branches :
66 - main
77 pull_request :
8- # ready_for_review starts CI when a draft PR becomes ready; converted_to_draft
9- # creates a skipped run that cancels any in-progress CI for the same PR ref.
8+ # Draft PRs run a reduced suite: the fast ubuntu lint/test jobs. The
9+ # expensive macOS/simulator and sample-build jobs are gated to non-draft
10+ # PRs via the changes.ready output. ready_for_review promotes a draft to the
11+ # full suite; converted_to_draft re-runs the reduced suite and cancels any
12+ # in-progress full run for the same PR ref.
1013 types : [opened, synchronize, reopened, ready_for_review, converted_to_draft]
1114 workflow_dispatch :
1215
@@ -25,9 +28,11 @@ concurrency:
2528jobs :
2629 changes :
2730 name : Detect Changed Areas
28- if : github.event_name != 'pull_request' || github.event.pull_request.draft == false
2931 runs-on : ubuntu-latest
3032 outputs :
33+ # true for pushes and non-draft PRs; false for draft PRs. Gates the
34+ # expensive macOS/simulator and sample-build jobs off draft PRs.
35+ ready : ${{ github.event_name != 'pull_request' || github.event.pull_request.draft == false }}
3136 android : ${{ steps.platform.outputs.android == 'true' || steps.platform.outputs.protocol == 'true' || steps.infra.outputs.android == 'true' }}
3237 swift : ${{ steps.platform.outputs.swift == 'true' || steps.platform.outputs.protocol == 'true' || steps.infra.outputs.swift == 'true' }}
3338 reactNative : ${{ steps.platform.outputs.reactNative == 'true' || steps.platform.outputs.swift == 'true' || steps.platform.outputs.android == 'true' || steps.platform.outputs.protocol == 'true' || steps.infra.outputs.reactNativeCommon == 'true' || steps.infra.outputs.reactNativeIos == 'true' || steps.infra.outputs.reactNativeAndroid == 'true' }}
@@ -101,24 +106,28 @@ jobs:
101106 needs : changes
102107 if : needs.changes.outputs.android == 'true'
103108 uses : ./.github/workflows/android-test.yml
109+ with :
110+ ready : ${{ needs.changes.outputs.ready == 'true' }}
104111
105112 swift-test-package :
106113 name : Swift
107114 needs : changes
108- if : needs.changes.outputs.swift == 'true'
115+ if : needs.changes.outputs.swift == 'true' && needs.changes.outputs.ready == 'true'
109116 uses : ./.github/workflows/swift-test-package.yml
110117
111118 swift-build-samples :
112119 name : Swift
113120 needs : changes
114- if : needs.changes.outputs.swift == 'true'
121+ if : needs.changes.outputs.swift == 'true' && needs.changes.outputs.ready == 'true'
115122 uses : ./.github/workflows/swift-build-samples.yml
116123
117124 swift-lint :
118125 name : Swift
119126 needs : changes
120127 if : needs.changes.outputs.swift == 'true'
121128 uses : ./.github/workflows/swift-lint.yml
129+ with :
130+ ready : ${{ needs.changes.outputs.ready == 'true' }}
122131
123132 swift-sample-package-paths :
124133 name : Swift Sample Package Paths
@@ -141,25 +150,25 @@ jobs:
141150 rn-test-android :
142151 name : React Native
143152 needs : changes
144- if : needs.changes.outputs.reactNativeAndroid == 'true'
153+ if : needs.changes.outputs.reactNativeAndroid == 'true' && needs.changes.outputs.ready == 'true'
145154 uses : ./.github/workflows/rn-test-android.yml
146155
147156 rn-test-ios :
148157 name : React Native
149158 needs : changes
150- if : needs.changes.outputs.reactNativeIos == 'true'
159+ if : needs.changes.outputs.reactNativeIos == 'true' && needs.changes.outputs.ready == 'true'
151160 uses : ./.github/workflows/rn-test-ios.yml
152161
153162 rn-build-android :
154163 name : React Native
155164 needs : changes
156- if : needs.changes.outputs.reactNativeAndroid == 'true'
165+ if : needs.changes.outputs.reactNativeAndroid == 'true' && needs.changes.outputs.ready == 'true'
157166 uses : ./.github/workflows/rn-build-android.yml
158167
159168 rn-build-ios :
160169 name : React Native
161170 needs : changes
162- if : needs.changes.outputs.reactNativeIos == 'true'
171+ if : needs.changes.outputs.reactNativeIos == 'true' && needs.changes.outputs.ready == 'true'
163172 uses : ./.github/workflows/rn-build-ios.yml
164173
165174 rn-check-packed-files :
@@ -192,7 +201,9 @@ jobs:
192201 needs.changes.outputs.reactNative == 'true'
193202 uses : ./.github/workflows/breaking-changes.yml
194203 with :
195- swift : ${{ needs.changes.outputs.swift }}
204+ # Swift API baseline runs on macOS — defer to non-draft PRs. The Android
205+ # and React Native baselines are cheap ubuntu jobs and run on drafts.
206+ swift : ${{ needs.changes.outputs.swift == 'true' && needs.changes.outputs.ready == 'true' }}
196207 android : ${{ needs.changes.outputs.android }}
197208 react-native : ${{ needs.changes.outputs.reactNative }}
198209
@@ -201,7 +212,9 @@ jobs:
201212 # because no files in that platform's tree changed.
202213 ci-required :
203214 name : CI Required
204- if : always() && (github.event_name != 'pull_request' || github.event.pull_request.draft == false)
215+ # Runs on drafts too, aggregating whichever jobs ran. Ready-only jobs report
216+ # "skipped" on drafts, which this gate treats as a pass.
217+ if : always()
205218 needs :
206219 - changes
207220 - android-test
0 commit comments