@@ -20,9 +20,25 @@ concurrency:
2020
2121jobs :
2222 full-suite :
23- name : iOS Runner Full XCTest Suite
23+ name : iOS Runner Full XCTest Suite (${{ matrix.leg.name }})
2424 runs-on : macos-26
2525 timeout-minutes : 45
26+ strategy :
27+ fail-fast : false
28+ matrix :
29+ leg :
30+ # Both legs share the toolchain, the runner build cache, and the artifact steps above.
31+ # The full suite runs on an iPhone, where the sole-screen rule is decided by the idiom
32+ # alone. The iPad leg boots an iPad and runs only the sole-screen tests: the iPad half
33+ # of the rule — the route opens only while the in-process full-screen evidence proves
34+ # the app fills its screen — can execute nowhere else, and the evidence line that probe
35+ # prints is what turns a revert to idiom-only routing red instead of silently green.
36+ - name : iPhone full suite
37+ device-name : iPhone 17 Pro
38+ lane : nightly
39+ - name : iPad sole-screen evidence
40+ device-name : iPad Pro 11-inch (M4)
41+ lane : nightly-ipad
2642 env :
2743 # Must match apple.yml. The runtime version rides in the derived-data cache key, and
2844 # AGENT_DEVICE_XCUITEST_INCLUDE_UNIT_TESTS is BOTH an input to the cache's build-variant
3854 AGENT_DEVICE_IOS_RUNNER_DERIVED_PATH : ${{ github.workspace }}/.tmp/ios-runner-derived
3955 RESULT_BUNDLE_PATH : ${{ github.workspace }}/.tmp/xctest-nightly/RunnerTests.xcresult
4056 RESULT_SUMMARY_PATH : ${{ github.workspace }}/.tmp/xctest-nightly/test-results-summary.json
41- XCTEST_LANE : nightly
57+ XCTEST_LANE : ${{ matrix.leg.lane }}
4258 steps :
4359 - name : Checkout
4460 uses : actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
6783 uses : ./.github/actions/boot-ios-test-simulator
6884 with :
6985 runtime-version : ${{ env.IOS_RUNTIME_VERSION }}
70- preferred-device-name : iPhone 17 Pro
86+ preferred-device-name : ${{ matrix.leg.device-name }}
7187
7288 # Same command as apple.yml's targeted step minus every `-only-testing:` flag, so the
7389 # xctestrun's own test plan decides what runs — with one exception.
84100 # A typo in that identifier silently re-arms the hang, so
85101 # `pnpm check:xctest-selection` validates `-skip-testing:` exactly like `-only-testing:`.
86102 - name : Run the full iOS runner XCTest suite
103+ if : matrix.leg.lane == 'nightly'
87104 run : |
88105 set -euo pipefail
89106 XCTESTRUN_PATH="$(find "$AGENT_DEVICE_IOS_RUNNER_DERIVED_PATH/Build/Products" -maxdepth 1 -name '*.xctestrun' -print -quit)"
@@ -102,6 +119,45 @@ jobs:
102119 }
103120 '
104121
122+ # The iPad leg's liveness check is its own grep below: it runs a named selection, not the
123+ # whole bundle, so the count assertion the full-suite leg makes does not apply to it. The
124+ # boot action falls back to any simulator when the preferred name is missing, so this step
125+ # proves it booted the iPad that leg claims — the evidence line can only come from one.
126+ - name : Run the sole-screen tests on iPad
127+ if : matrix.leg.lane == 'nightly-ipad'
128+ run : |
129+ set -euo pipefail
130+ UDID='${{ steps.ios-simulator.outputs.simulator-udid }}'
131+ xcrun simctl list devices -j | node -e '
132+ const fs = require("node:fs");
133+ const udid = process.argv[1];
134+ const payload = JSON.parse(fs.readFileSync(0, "utf8"));
135+ const device = Object.values(payload.devices ?? {})
136+ .flat()
137+ .find((entry) => entry.udid === udid);
138+ if (!device?.name?.startsWith("iPad")) {
139+ console.error(`Booted ${device?.name ?? udid}; this leg needs an iPad simulator`);
140+ process.exit(1);
141+ }
142+ ' "$UDID"
143+ XCTESTRUN_PATH="$(find "$AGENT_DEVICE_IOS_RUNNER_DERIVED_PATH/Build/Products" -maxdepth 1 -name '*.xctestrun' -print -quit)"
144+ test -n "$XCTESTRUN_PATH"
145+ xcodebuild test-without-building \
146+ -xctestrun "$XCTESTRUN_PATH" \
147+ -destination "platform=iOS Simulator,id=$UDID" \
148+ -only-testing:AgentDeviceRunnerUITests/RunnerTests/testLongPressOnAnUnserializableTreeIsSynthesizedOnTheSoleScreen \
149+ -only-testing:AgentDeviceRunnerUITests/RunnerTests/testGestureViewportOnAnUnserializableTreeIsTheSoleScreen \
150+ -only-testing:AgentDeviceRunnerUITests/RunnerTests/testSoleScreenDisplayIDIsNamedOnlyForAnAppThatFillsItsScreen \
151+ -only-testing:AgentDeviceRunnerUITests/RunnerTests/testInAppBackVerifiesSoleScreenWhenXCTestCannotReadFramesOrEnumerate \
152+ -only-testing:AgentDeviceRunnerUITests/RunnerTests/testInAppBackAfterARejectedQueryTapsThroughTheRouteThatOpens \
153+ -only-testing:AgentDeviceRunnerUITests/RunnerTests/testRankedInAppBackUsesSynthesisWithoutXCTestTap \
154+ 2>&1 | tee .tmp/xctest-nightly/runner.log
155+ # The probe prints this line only when a non-phone idiom asks it. Its absence means the
156+ # iPad never probed (a revert to idiom-only routing), not that a test failed.
157+ grep -q 'AGENT_DEVICE_RUNNER_FULL_SCREEN_EVIDENCE result=fills-screen' \
158+ .tmp/xctest-nightly/runner.log \
159+ || { echo 'The iPad sole-screen route never produced full-screen evidence.'; exit 1; }
160+
105161 # Best-effort and never the job's verdict on its own; the step below is what asserts.
106162 # `--compact` first because a red night's summary is the large one, and the job summary
107163 # has a 1 MiB cap — the plain form is the fallback if an Xcode version rejects the flag.
@@ -126,7 +182,7 @@ jobs:
126182 # as red too. The failure list is capped so a badly red night cannot blow the 1 MiB
127183 # job-summary limit and lose the headline with it.
128184 - name : Report the run and assert the source-derived count
129- if : always()
185+ if : always() && matrix.leg.lane == 'nightly'
130186 run : |
131187 set -euo pipefail
132188 if [ ! -s "$RESULT_SUMMARY_PATH" ]; then
@@ -142,96 +198,7 @@ jobs:
142198 if : always()
143199 uses : actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
144200 with :
145- name : xctest-nightly-results -${{ github.run_id }}-${{ github.run_attempt }}
201+ name : xctest-nightly-${{ matrix.leg.lane }} -${{ github.run_id }}-${{ github.run_attempt }}
146202 include-hidden-files : true
147203 path : .tmp/xctest-nightly
148204 if-no-files-found : warn
149-
150- # The full suite above runs on an iPhone, where the sole-screen rule is decided by the idiom
151- # alone. The iPad half of the rule — the route opens only while the in-process full-screen
152- # evidence proves the app fills its screen — can only execute on an iPad. This leg boots one,
153- # runs the sole-screen tests, and asserts the evidence line the probe prints: no other lane can
154- # emit it, so a revert to idiom-only routing turns this red instead of silently green.
155- ipad-sole-screen :
156- name : iOS Runner Sole-Screen Evidence (iPad)
157- runs-on : macos-26
158- timeout-minutes : 30
159- env :
160- # Byte-identical inputs to the job above, so both restore the same runner cache entry.
161- IOS_RUNTIME_VERSION : ' 26.2'
162- AGENT_DEVICE_XCUITEST_ARCHS : ' arm64'
163- AGENT_DEVICE_XCUITEST_INCLUDE_UNIT_TESTS : ' 1'
164- AGENT_DEVICE_IOS_RUNNER_DERIVED_PATH : ${{ github.workspace }}/.tmp/ios-runner-derived
165- steps :
166- - name : Checkout
167- uses : actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
168-
169- - name : Setup toolchain
170- uses : ./.github/actions/setup-node-pnpm
171- with :
172- cache-dependency-path : |
173- pnpm-lock.yaml
174- examples/test-app/pnpm-lock.yaml
175-
176- - name : Restore and build iOS XCTest runner
177- uses : ./.github/actions/setup-apple-runner-build
178- with :
179- derived-path : ${{ env.AGENT_DEVICE_IOS_RUNNER_DERIVED_PATH }}
180- cache-key-prefix : ios-runner-prebuilt
181- cache-key-suffix : -ios-${{ env.IOS_RUNTIME_VERSION }}-arm64
182- gate : swift-runner-ios
183- xcuitest-platform : ios
184- xcuitest-destination : generic/platform=iOS Simulator
185-
186- - name : Boot iPad test simulator
187- id : ipad-simulator
188- uses : ./.github/actions/boot-ios-test-simulator
189- with :
190- runtime-version : ${{ env.IOS_RUNTIME_VERSION }}
191- preferred-device-name : iPad Pro 11-inch (M4)
192-
193- - name : Run the sole-screen tests on iPad
194- run : |
195- set -euo pipefail
196- UDID='${{ steps.ipad-simulator.outputs.simulator-udid }}'
197- # The boot action falls back to any simulator when the preferred name is missing. This
198- # leg proves an iPad-only rule, so a non-iPad fallback must fail here, not at the grep.
199- xcrun simctl list devices -j | node -e '
200- const fs = require("node:fs");
201- const udid = process.argv[1];
202- const payload = JSON.parse(fs.readFileSync(0, "utf8"));
203- const device = Object.values(payload.devices ?? {})
204- .flat()
205- .find((entry) => entry.udid === udid);
206- if (!device?.name?.startsWith("iPad")) {
207- console.error(`Booted ${device?.name ?? udid}; this leg needs an iPad simulator`);
208- process.exit(1);
209- }
210- ' "$UDID"
211- XCTESTRUN_PATH="$(find "$AGENT_DEVICE_IOS_RUNNER_DERIVED_PATH/Build/Products" -maxdepth 1 -name '*.xctestrun' -print -quit)"
212- test -n "$XCTESTRUN_PATH"
213- mkdir -p .tmp/xctest-nightly-ipad
214- xcodebuild test-without-building \
215- -xctestrun "$XCTESTRUN_PATH" \
216- -destination "platform=iOS Simulator,id=${{ steps.ipad-simulator.outputs.simulator-udid }}" \
217- -only-testing:AgentDeviceRunnerUITests/RunnerTests/testLongPressOnAnUnserializableTreeIsSynthesizedOnTheSoleScreen \
218- -only-testing:AgentDeviceRunnerUITests/RunnerTests/testGestureViewportOnAnUnserializableTreeIsTheSoleScreen \
219- -only-testing:AgentDeviceRunnerUITests/RunnerTests/testSoleScreenDisplayIDIsNamedOnlyForAnAppThatFillsItsScreen \
220- -only-testing:AgentDeviceRunnerUITests/RunnerTests/testInAppBackVerifiesSoleScreenWhenXCTestCannotReadFramesOrEnumerate \
221- -only-testing:AgentDeviceRunnerUITests/RunnerTests/testInAppBackStillAsksForWindowsWhereNoSoleScreenAnswers \
222- -only-testing:AgentDeviceRunnerUITests/RunnerTests/testRankedInAppBackUsesSynthesisWithoutXCTestTap \
223- 2>&1 | tee .tmp/xctest-nightly-ipad/runner.log
224- # The probe prints this line only when a non-phone idiom asks it. Its absence means the
225- # iPad never probed (a revert to idiom-only routing), not that a test failed.
226- grep -q 'AGENT_DEVICE_RUNNER_FULL_SCREEN_EVIDENCE result=fills-screen' \
227- .tmp/xctest-nightly-ipad/runner.log \
228- || { echo 'The iPad sole-screen route never produced full-screen evidence.'; exit 1; }
229-
230- - name : Upload iPad log
231- if : always()
232- uses : actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
233- with :
234- name : xctest-nightly-ipad-${{ github.run_id }}-${{ github.run_attempt }}
235- include-hidden-files : true
236- path : .tmp/xctest-nightly-ipad
237- if-no-files-found : warn
0 commit comments