Skip to content

Commit 112a023

Browse files
Patch for <macOS 15 build systems (#283)
* Prevent units tests from succeeding on error * Use compiler flags for mltensor sampling * Add flag for mltensor utils * Update platform versions for development and pre-release tests workflows * Differentiate artifact name in unit-tests.yml workflow * Stop unit tests early if run condition is false * Fix macos 14 runner ios version * Use success error code for expected test skipping * Lower priority of early stopping task, cleanup * Formatting * Fix tests, attempt to lower early stopping task priority further * Fix inverted action run condition logic * Use detached lower priority for early stopping to resolve priority inversion * Fix tests * Set test priority for early stopping, fix correctness test on macos 14 * Upgrade unit test task priority * Specify device for older iOS simulators * Fix workflow for ios-device * Disable ealy stopping test on watchos * Set xcode version on CI * Make sure test simulator is available on runner
1 parent d191654 commit 112a023

File tree

7 files changed

+328
-239
lines changed

7 files changed

+328
-239
lines changed

.github/workflows/development-tests.yml

+17-3
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,8 @@ jobs:
1515
name: "Build and Test"
1616
uses: ./.github/workflows/unit-tests.yml
1717
with:
18-
ios-version: "18.1"
18+
ios-version: "18.2"
19+
ios-device: "iPhone 16"
1920
macos-runner: "macos-15"
2021

2122
check-approvals:
@@ -42,7 +43,20 @@ jobs:
4243
name: "Pre-merge Tests"
4344
needs: [check-approvals]
4445
if: needs.check-approvals.outputs.reviews == 'APPROVED' || github.event_name == 'workflow_dispatch'
46+
strategy:
47+
matrix:
48+
include:
49+
- os: macos-13-xlarge
50+
ios-version: "17.2"
51+
ios-device: "iPhone 14"
52+
xcode-version: "15.2"
53+
- os: macos-14
54+
ios-version: "17.2"
55+
ios-device: "iPhone 15"
56+
xcode-version: "15.2"
4557
uses: ./.github/workflows/unit-tests.yml
4658
with:
47-
ios-version: "16.1"
48-
macos-runner: "macos-13-xlarge"
59+
macos-runner: ${{ matrix.os }}
60+
ios-version: ${{ matrix.ios-version }}
61+
ios-device: ${{ matrix.ios-device }}
62+
xcode-version: ${{ matrix.xcode-version }}

.github/workflows/pre-release-tests.yml

+13-3
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,20 @@ jobs:
1212
matrix:
1313
include:
1414
- os: macos-13-xlarge
15-
ios-version: "16.1" # Oldest available version
15+
ios-version: "17.2" # TODO: Download older simulators for macOS 13
16+
ios-device: "iPhone 14"
17+
xcode-version: "15.2"
18+
- os: macos-14
19+
ios-version: "17.2"
20+
ios-device: "iPhone 15"
21+
xcode-version: "15.2"
1622
- os: macos-15
17-
ios-version: "18.1" # Latest available version
23+
ios-version: "18.2" # Latest available version
24+
ios-device: "iPhone 16"
25+
xcode-version: "latest-stable"
1826
uses: ./.github/workflows/unit-tests.yml
1927
with:
20-
ios-version: ${{ matrix.ios-version }}
2128
macos-runner: ${{ matrix.os }}
29+
ios-version: ${{ matrix.ios-version }}
30+
ios-device: ${{ matrix.ios-device }}
31+
xcode-version: ${{ matrix.xcode-version }}

.github/workflows/unit-tests.yml

+14-8
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,15 @@ on:
66
ios-version:
77
required: true
88
type: string
9+
ios-device:
10+
required: true
11+
type: string
912
macos-runner:
1013
required: true
1114
type: string
15+
xcode-version:
16+
required: false
17+
type: string
1218

1319
jobs:
1420
unit-tests:
@@ -27,7 +33,7 @@ jobs:
2733
name: "iOS",
2834
condition: true,
2935
clean-destination: "generic/platform=iOS",
30-
test-destination: "platform=iOS Simulator,OS=${{ inputs.ios-version }},name=iPhone 16",
36+
test-destination: "platform=iOS Simulator,OS=${{ inputs.ios-version }},name=${{ inputs.ios-device }}",
3137
}
3238
- {
3339
name: "watchOS",
@@ -46,7 +52,7 @@ jobs:
4652
- uses: actions/checkout@v4
4753
- uses: maxim-lobanov/setup-xcode@v1
4854
with:
49-
xcode-version: latest-stable
55+
xcode-version: ${{ inputs.xcode-version || 'latest-stable' }}
5056
- name: Setup environment
5157
run: make setup
5258
- name: Setup Cache
@@ -59,14 +65,17 @@ jobs:
5965
if: steps.model-cache.outputs.cache-hit != 'true'
6066
run: make download-model MODEL=tiny
6167
- name: Install and discover destinations
68+
if: ${{ matrix.run-config['condition'] == true }}
6269
run: |
6370
if [[ "${{ matrix.run-config['name'] }}" != "macOS" ]]; then
6471
xcodebuild -downloadPlatform ${{ matrix.run-config['name'] }}
6572
fi
73+
echo "Runtimes for testing:"
74+
xcrun simctl list runtimes
6675
echo "Destinations for testing:"
6776
xcodebuild test-without-building -only-testing WhisperKitTests/UnitTests -scheme whisperkit-Package -showdestinations
6877
- name: Boot Simulator and Wait
69-
if: ${{ matrix.run-config['name'] != 'macOS' }} && ${{ inputs.macos-runner == 'macos-15' }}
78+
if: ${{ matrix.run-config['condition'] == true }} && ${{ matrix.run-config['name'] != 'macOS' }} && ${{ inputs.macos-runner == 'macos-15' }}
7079
# Slower runners require some time to fully boot the simulator
7180
# Parse the simulator name from the destination string, boot it, and wait
7281
run: |
@@ -75,19 +84,16 @@ jobs:
7584
sleep 15
7685
xcrun simctl list devices
7786
- name: Build and Test - ${{ matrix.run-config['name'] }}
78-
id: test-step
7987
if: ${{ matrix.run-config['condition'] == true }}
80-
continue-on-error: true
8188
run: |
8289
set -o pipefail
8390
xcodebuild clean build-for-testing -scheme whisperkit-Package -destination '${{ matrix.run-config['clean-destination'] }}' | xcpretty
8491
xcodebuild test -only-testing WhisperKitTests/UnitTests -scheme whisperkit-Package -destination '${{ matrix.run-config['test-destination'] }}'
85-
8692
- name: Upload Test Results
87-
if: failure() && steps.test-step.outcome == 'failure'
93+
if: failure()
8894
uses: actions/upload-artifact@v4
8995
with:
90-
name: test-results-${{ matrix.run-config['name'] }}
96+
name: test-results-${{ matrix.run-config['name']}}-on-${{ inputs.macos-runner }}
9197
path: |
9298
~/Library/Developer/Xcode/DerivedData/**/Logs/Test/*.xcresult
9399
retention-days: 5

0 commit comments

Comments
 (0)