Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Patch for <macOS 15 build systems #283

Merged
merged 21 commits into from
Dec 21, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
21 commits
Select commit Hold shift + click to select a range
4915574
Prevent units tests from succeeding on error
ZachNagengast Dec 20, 2024
2eff5b0
Use compiler flags for mltensor sampling
ZachNagengast Dec 20, 2024
936e4ed
Add flag for mltensor utils
ZachNagengast Dec 20, 2024
c39f052
Update platform versions for development and pre-release tests workflows
ZachNagengast Dec 20, 2024
f1f5dbe
Differentiate artifact name in unit-tests.yml workflow
ZachNagengast Dec 20, 2024
b43015f
Stop unit tests early if run condition is false
ZachNagengast Dec 20, 2024
13cf628
Fix macos 14 runner ios version
ZachNagengast Dec 20, 2024
9020e30
Use success error code for expected test skipping
ZachNagengast Dec 20, 2024
ac83405
Lower priority of early stopping task, cleanup
ZachNagengast Dec 20, 2024
2a8b95b
Formatting
ZachNagengast Dec 20, 2024
5a5517d
Fix tests, attempt to lower early stopping task priority further
ZachNagengast Dec 20, 2024
87d1720
Fix inverted action run condition logic
ZachNagengast Dec 20, 2024
cf0b880
Use detached lower priority for early stopping to resolve priority in…
ZachNagengast Dec 20, 2024
f052eac
Fix tests
ZachNagengast Dec 20, 2024
cb589e4
Set test priority for early stopping, fix correctness test on macos 14
ZachNagengast Dec 20, 2024
59ef54f
Upgrade unit test task priority
ZachNagengast Dec 20, 2024
f2d3c22
Specify device for older iOS simulators
ZachNagengast Dec 20, 2024
024049c
Fix workflow for ios-device
ZachNagengast Dec 20, 2024
1d3b1f4
Disable ealy stopping test on watchos
ZachNagengast Dec 20, 2024
250ed9d
Set xcode version on CI
ZachNagengast Dec 20, 2024
75bf130
Make sure test simulator is available on runner
ZachNagengast Dec 21, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 17 additions & 3 deletions .github/workflows/development-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,8 @@ jobs:
name: "Build and Test"
uses: ./.github/workflows/unit-tests.yml
with:
ios-version: "18.1"
ios-version: "18.2"
ios-device: "iPhone 16"
macos-runner: "macos-15"

check-approvals:
Expand All @@ -42,7 +43,20 @@ jobs:
name: "Pre-merge Tests"
needs: [check-approvals]
if: needs.check-approvals.outputs.reviews == 'APPROVED' || github.event_name == 'workflow_dispatch'
strategy:
matrix:
include:
- os: macos-13-xlarge
ios-version: "17.2"
ios-device: "iPhone 14"
xcode-version: "15.2"
- os: macos-14
ios-version: "17.2"
ios-device: "iPhone 15"
xcode-version: "15.2"
uses: ./.github/workflows/unit-tests.yml
with:
ios-version: "16.1"
macos-runner: "macos-13-xlarge"
macos-runner: ${{ matrix.os }}
ios-version: ${{ matrix.ios-version }}
ios-device: ${{ matrix.ios-device }}
xcode-version: ${{ matrix.xcode-version }}
16 changes: 13 additions & 3 deletions .github/workflows/pre-release-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,20 @@ jobs:
matrix:
include:
- os: macos-13-xlarge
ios-version: "16.1" # Oldest available version
ios-version: "17.2" # TODO: Download older simulators for macOS 13
ios-device: "iPhone 14"
xcode-version: "15.2"
- os: macos-14
ios-version: "17.2"
ios-device: "iPhone 15"
xcode-version: "15.2"
- os: macos-15
ios-version: "18.1" # Latest available version
ios-version: "18.2" # Latest available version
ios-device: "iPhone 16"
xcode-version: "latest-stable"
uses: ./.github/workflows/unit-tests.yml
with:
ios-version: ${{ matrix.ios-version }}
macos-runner: ${{ matrix.os }}
ios-version: ${{ matrix.ios-version }}
ios-device: ${{ matrix.ios-device }}
xcode-version: ${{ matrix.xcode-version }}
22 changes: 14 additions & 8 deletions .github/workflows/unit-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,15 @@ on:
ios-version:
required: true
type: string
ios-device:
required: true
type: string
macos-runner:
required: true
type: string
xcode-version:
required: false
type: string

jobs:
unit-tests:
Expand All @@ -27,7 +33,7 @@ jobs:
name: "iOS",
condition: true,
clean-destination: "generic/platform=iOS",
test-destination: "platform=iOS Simulator,OS=${{ inputs.ios-version }},name=iPhone 16",
test-destination: "platform=iOS Simulator,OS=${{ inputs.ios-version }},name=${{ inputs.ios-device }}",
}
- {
name: "watchOS",
Expand All @@ -46,7 +52,7 @@ jobs:
- uses: actions/checkout@v4
- uses: maxim-lobanov/setup-xcode@v1
with:
xcode-version: latest-stable
xcode-version: ${{ inputs.xcode-version || 'latest-stable' }}
- name: Setup environment
run: make setup
- name: Setup Cache
Expand All @@ -59,14 +65,17 @@ jobs:
if: steps.model-cache.outputs.cache-hit != 'true'
run: make download-model MODEL=tiny
- name: Install and discover destinations
if: ${{ matrix.run-config['condition'] == true }}
run: |
if [[ "${{ matrix.run-config['name'] }}" != "macOS" ]]; then
xcodebuild -downloadPlatform ${{ matrix.run-config['name'] }}
fi
echo "Runtimes for testing:"
xcrun simctl list runtimes
echo "Destinations for testing:"
xcodebuild test-without-building -only-testing WhisperKitTests/UnitTests -scheme whisperkit-Package -showdestinations
- name: Boot Simulator and Wait
if: ${{ matrix.run-config['name'] != 'macOS' }} && ${{ inputs.macos-runner == 'macos-15' }}
if: ${{ matrix.run-config['condition'] == true }} && ${{ matrix.run-config['name'] != 'macOS' }} && ${{ inputs.macos-runner == 'macos-15' }}
# Slower runners require some time to fully boot the simulator
# Parse the simulator name from the destination string, boot it, and wait
run: |
Expand All @@ -75,19 +84,16 @@ jobs:
sleep 15
xcrun simctl list devices
- name: Build and Test - ${{ matrix.run-config['name'] }}
id: test-step
if: ${{ matrix.run-config['condition'] == true }}
continue-on-error: true
run: |
set -o pipefail
xcodebuild clean build-for-testing -scheme whisperkit-Package -destination '${{ matrix.run-config['clean-destination'] }}' | xcpretty
xcodebuild test -only-testing WhisperKitTests/UnitTests -scheme whisperkit-Package -destination '${{ matrix.run-config['test-destination'] }}'

- name: Upload Test Results
if: failure() && steps.test-step.outcome == 'failure'
if: failure()
uses: actions/upload-artifact@v4
with:
name: test-results-${{ matrix.run-config['name'] }}
name: test-results-${{ matrix.run-config['name']}}-on-${{ inputs.macos-runner }}
path: |
~/Library/Developer/Xcode/DerivedData/**/Logs/Test/*.xcresult
retention-days: 5
Loading
Loading