Skip to content

Commit 192eeeb

Browse files
authored
fix: speed up ci (#27)
1 parent adbb78d commit 192eeeb

7 files changed

Lines changed: 84 additions & 15 deletions

File tree

.github/workflows/platform-integration-ios.yml

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ jobs:
7878
uses: actions/cache@v5
7979
with:
8080
path: godot/bin/libgodot.ios.template_debug.arm64.simulator.a
81-
key: ${{ runner.os }}-${{ runner.arch }}-godot-${{ env.GODOT_VERSION }}-${{ steps.xcode.outputs.version }}-ios-simulator-template-${{ hashFiles('scripts/build*.ts') }}
81+
key: ${{ runner.os }}-${{ runner.arch }}-godot-${{ env.GODOT_VERSION }}-${{ steps.xcode.outputs.version }}-ios-template_debug-arm64-simulator
8282

8383
- name: Enable Corepack
8484
run: mise x -- corepack enable pnpm
@@ -98,8 +98,8 @@ jobs:
9898
- name: Install pnpm dependencies
9999
run: mise x -- corepack pnpm install --frozen-lockfile
100100

101-
- name: Build iOS XCFramework
102-
run: mise run build:ios-xcframework
101+
- name: Build iOS debug XCFramework
102+
run: mise run build:ios-debug-xcframework
103103

104104
- name: Build integration App
105105
run: mise run build:integration-ios
@@ -113,10 +113,6 @@ jobs:
113113
xcrun simctl bootstatus "$DEVICE_ID"
114114
echo "SIMULATOR_ID=$DEVICE_ID" >> $GITHUB_ENV
115115
116-
- name: Run iOS IPC serialization test
117-
timeout-minutes: 10
118-
run: mise run test:ios-ipc-serialization
119-
120116
- name: Install integration app
121117
run: xcrun simctl install $SIMULATOR_ID dist/integration/ios_debug.app
122118

.github/workflows/unittest.yml

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,3 +52,53 @@ jobs:
5252

5353
- name: Run unit tests
5454
run: mise run test:unit
55+
56+
ios-ipc-serialization:
57+
name: iOS IPC serialization
58+
runs-on: macos-latest
59+
env:
60+
HOMEBREW_NO_AUTO_UPDATE: "1"
61+
HOMEBREW_NO_INSTALL_CLEANUP: "1"
62+
MISE_EXEC_AUTO_INSTALL: "false"
63+
MISE_NOT_FOUND_AUTO_INSTALL: "false"
64+
65+
steps:
66+
- name: Checkout
67+
uses: actions/checkout@v6
68+
69+
- name: Install Node
70+
uses: jdx/mise-action@v3
71+
with:
72+
install: true
73+
install_args: node
74+
cache: true
75+
76+
- name: Setup Xcode version
77+
uses: maxim-lobanov/setup-xcode@v1
78+
with:
79+
xcode-version: latest-stable
80+
81+
- name: Install XcodeGen
82+
run: brew install xcodegen
83+
84+
- name: Enable Corepack
85+
run: mise x -- corepack enable pnpm
86+
87+
- name: Get pnpm store path
88+
id: pnpm-store
89+
run: echo "path=$(mise x -- corepack pnpm store path --silent)" >> "$GITHUB_OUTPUT"
90+
91+
- name: Cache pnpm store
92+
uses: actions/cache@v5
93+
with:
94+
path: ${{ steps.pnpm-store.outputs.path }}
95+
key: ${{ runner.os }}-${{ runner.arch }}-pnpm-store-${{ hashFiles('pnpm-lock.yaml') }}
96+
restore-keys: |
97+
${{ runner.os }}-${{ runner.arch }}-pnpm-store-
98+
99+
- name: Install pnpm dependencies
100+
run: mise x -- corepack pnpm install --frozen-lockfile
101+
102+
- name: Run iOS IPC serialization unit tests
103+
timeout-minutes: 10
104+
run: mise run test:ios-ipc-serialization

docs/platform-integration-tests.md

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,9 @@ The current focus is:
2929

3030
The browser fixture uses `@gd-kirie/ipc` to exercise the text, binary, and data
3131
lanes across the platform runners. iOS also keeps a native XCTest coverage point
32-
for CBOR serialization. Eventa adapter behavior should be tested separately.
32+
for CBOR serialization, but that runs in the Unit Tests workflow rather than the
33+
platform integration workflows. Eventa adapter behavior should be tested
34+
separately.
3335

3436
The C# wrapper should be covered by a small exported-app smoke test that uses
3537
`KirieClient` events and verifies the same WebView IPC round-trip as the
@@ -218,6 +220,9 @@ Run the native iOS CBOR serialization test:
218220
mise run test:ios-ipc-serialization
219221
```
220222

223+
This is unit-style XCTest coverage for the Swift codec, not an exported-app
224+
platform integration test.
225+
221226
By default this uses the `iPhone 16` simulator destination. Override the
222227
destination when a local machine has a different simulator:
223228

@@ -226,10 +231,10 @@ IOS_TEST_DESTINATION="platform=iOS Simulator,name=iPhone 15" \
226231
mise run test:ios-ipc-serialization
227232
```
228233

229-
Build the staged iOS addon XCFramework first:
234+
Build the staged iOS debug addon XCFramework first:
230235

231236
```bash
232-
mise run build:ios-xcframework
237+
mise run build:ios-debug-xcframework
233238
```
234239

235240
Build the simulator app:

mise.toml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,10 @@ run = "./scripts/run-build-task.js buildIntegrationIos"
5151
description = "Build iOS xcframework artifact"
5252
run = "./scripts/run-build-task.js buildIosXcframework"
5353

54+
[tasks."build:ios-debug-xcframework"]
55+
description = "Build iOS debug xcframework artifact"
56+
run = "./scripts/run-build-task.js buildIosDebugXcframework"
57+
5458
[tasks."install:godot-cef"]
5559
description = "Install pinned Godot CEF desktop addon into a Godot project"
5660
usage = '''

packages/kirie/native/ios/Kirie/Sources/Kirie/KirieIpcPacketCodec.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -161,7 +161,7 @@ enum KirieIpcPacketCodec {
161161
/// Decodes exactly one CBOR data item from `packet`, rejecting trailing bytes.
162162
private static func decodeSingleCBOR(_ packet: Data) throws -> CBOR {
163163
let bytes = [UInt8](packet)
164-
var decoder = CBORDecoder(input: bytes)
164+
let decoder = CBORDecoder(input: bytes)
165165

166166
guard let cbor = try decoder.decodeItem() else {
167167
// Empty input — no item to decode.

scripts/build-kirie.ts

Lines changed: 17 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -103,6 +103,8 @@ function sha256File(filePath: string): string {
103103
}
104104

105105
async function generateIosProject(): Promise<void> {
106+
fs.mkdirSync(iosGeneratedDir, { recursive: true });
107+
106108
await execa(
107109
"xcodegen",
108110
[
@@ -187,6 +189,12 @@ async function createIosXcframework(
187189
);
188190
}
189191

192+
function prepareIosBuildDirs(): void {
193+
fs.mkdirSync(iosBuildDir, { recursive: true });
194+
fs.mkdirSync(iosGeneratedDir, { recursive: true });
195+
fs.mkdirSync(iosOutputDir, { recursive: true });
196+
}
197+
190198
// mise task entrypoint.
191199
export function checkAddonPack(): void {
192200
assertPathExists(addonStageDir);
@@ -288,17 +296,22 @@ export async function buildAndroidAar(): Promise<void> {
288296

289297
// mise task entrypoint.
290298
export async function buildIosXcframework(): Promise<void> {
291-
fs.mkdirSync(iosBuildDir, { recursive: true });
292-
fs.mkdirSync(iosGeneratedDir, { recursive: true });
293-
fs.mkdirSync(iosOutputDir, { recursive: true });
294-
299+
prepareIosBuildDirs();
295300
await generateIosProject();
296301

297302
fs.rmSync(iosLegacyOutputXcframework, { force: true, recursive: true });
298303
await createIosXcframework("ReleaseDebug", "debug", iosDebugOutputXcframework);
299304
await createIosXcframework("Release", "release", iosReleaseOutputXcframework);
300305
}
301306

307+
// mise task entrypoint.
308+
export async function buildIosDebugXcframework(): Promise<void> {
309+
prepareIosBuildDirs();
310+
await generateIosProject();
311+
312+
await createIosXcframework("ReleaseDebug", "debug", iosDebugOutputXcframework);
313+
}
314+
302315
// mise task entrypoint.
303316
export async function testIosIpcSerialization(): Promise<void> {
304317
if (!fs.existsSync(`${iosPluginDir}/project.yml`)) {

scripts/build.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ export {
77
} from "./build-integration.ts";
88
export {
99
buildAndroidAar,
10+
buildIosDebugXcframework,
1011
buildIosXcframework,
1112
checkAddonPack,
1213
installGodotCef,

0 commit comments

Comments
 (0)