ci(ios): build and test with Xcode 27

The iPhone Duo layout uses UIHingeInteraction, which only exists in
the iOS 27.1 SDK. CI ran Xcode 16.4 (iOS 18.5 SDK) on macos-15, so the
app build failed: #available is a runtime check and cannot hide a
symbol the SDK lacks. ChatView's iOS 26/27 modifiers would have failed
next.

Both jobs now run on the xcode-27 runner image (Xcode 27.1 by default),
the toolchain releases are built with. The READMEs state Xcode 27.1 as
the minimum.

Swift 6.4 also timed out type-checking a long `+` chain in
MultipartEncoderTests, so `swift test` failed to build; the expected
body is now joined from an array.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
weishu
2026-10-28 19:25:18 +08:00
co-authored by Claude Opus 5.5
parent e733dffe10
commit 4b7a1cff90
4 changed files with 20 additions and 17 deletions
+3 -2
View File
@@ -19,8 +19,9 @@ concurrency:
cancel-in-progress: true
jobs:
# Xcode 27.1+ is required: the app uses iOS 27.1 SDK APIs (e.g. UIHingeInteraction).
package-tests:
runs-on: macos-15
runs-on: xcode-27
steps:
- uses: actions/checkout@v4
- name: Show toolchain versions
@@ -31,7 +32,7 @@ jobs:
run: swift test --package-path ios/Packages/HapiKit
app-build:
runs-on: macos-15
runs-on: xcode-27
steps:
- uses: actions/checkout@v4
- name: Show toolchain versions
+1 -1
View File
@@ -22,7 +22,7 @@ or Apple developer setup is needed on your hub. See [Notifications](#notificatio
### Build from source (developers)
The app source is in the repository. Development builds follow the
[iOS README](https://github.com/tiann/hapi/blob/main/ios/README.md) (Xcode 16
[iOS README](https://github.com/tiann/hapi/blob/main/ios/README.md) (Xcode 27.1
or newer, shared `Hapi` scheme; device builds require signing) or the
[Android README](https://github.com/tiann/hapi/blob/main/android/README.md)
(JDK 17+, Android SDK, Gradle wrapper). Self-built apps need their own push
@@ -15,18 +15,19 @@ struct MultipartEncoderTests {
data: Data([0x01, 0x02])
)
// Joined rather than `+`-chained: Swift 6.4 times out type-checking the chain.
var expected = Data(
(
"--B\r\n"
+ "Content-Disposition: form-data; name=\"provider\"\r\n\r\n"
+ "openai\r\n"
+ "--B\r\n"
+ "Content-Disposition: form-data; name=\"mode\"\r\n\r\n"
+ "standard\r\n"
+ "--B\r\n"
+ "Content-Disposition: form-data; name=\"file\"; filename=\"clip.m4a\"\r\n"
+ "Content-Type: audio/mp4\r\n\r\n"
).utf8
[
"--B\r\n",
"Content-Disposition: form-data; name=\"provider\"\r\n\r\n",
"openai\r\n",
"--B\r\n",
"Content-Disposition: form-data; name=\"mode\"\r\n\r\n",
"standard\r\n",
"--B\r\n",
"Content-Disposition: form-data; name=\"file\"; filename=\"clip.m4a\"\r\n",
"Content-Type: audio/mp4\r\n\r\n",
].joined().utf8
)
expected.append(Data([0x01, 0x02]))
expected.append(Data("\r\n--B--\r\n".utf8))
+4 -3
View File
@@ -26,7 +26,8 @@ for platform differences, web-only features and everyday use.
## Requirements
- Xcode 16 or newer with Swift 6 support.
- Xcode 27.1 or newer (the app uses iOS 27.1 SDK APIs such as
`UIHingeInteraction`).
- Deployment target: iOS 17.0.
- Runtime dependencies (SPM, declared in `Packages/HapiKit/Package.swift`,
used only by the `HapiUI` target): `swiftlang/swift-markdown` (GFM parsing
@@ -52,8 +53,8 @@ swift test --package-path ios/Packages/HapiKit
```
CI runs package tests, the simulator build, and app-hosted transcript tests
on `macos-15` via `.github/workflows/ios.yml` (triggered by changes under
`ios/**` and `shared/fixtures/**`).
on the `xcode-27` runner image via `.github/workflows/ios.yml` (triggered by
changes under `ios/**` and `shared/fixtures/**`).
### Linux verification (no Mac needed)