Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
56 changes: 56 additions & 0 deletions .github/workflows/swift.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
name: Test Swift Package on iOS

on:
push:
branches: [ main ]
pull_request:
branches: [ main ]

jobs:
test:
name: Test Swift 6.0 on iOS (${{ matrix.config }})
runs-on: macos-latest # iOS testing requires macOS

strategy:
matrix:
config: [debug, release]

steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: Select Xcode (latest)
uses: maxim-lobanov/setup-xcode@v1
with:
xcode-version: 'latest'

- name: Setup Swift 6.0
uses: SwiftyLab/setup-swift@latest
with:
swift-version: '6.0' # Use quotes to ensure correct version parsing

- name: Check Swift version
run: swift --version

- name: Find an iOS Simulator
id: find_simulator
run: |
# Find an available iOS simulator runtime and device
RUNTIME_ID=$(xcrun simctl list runtimes ios --json | jq -r '.runtimes[0].identifier')
if [ -z "$RUNTIME_ID" ] || [ "$RUNTIME_ID" == "null" ]; then
echo "::error::No iOS runtime found."
exit 1
fi
DEVICE_ID=$(xcrun simctl list devices --json | jq -r --arg RT_ID "$RUNTIME_ID" '.devices[$RT_ID] | map(select(.isAvailable)) | .[0].udid')
if [ -z "$DEVICE_ID" ] || [ "$DEVICE_ID" == "null" ]; then
echo "::error::No available iOS simulator device found for runtime $RUNTIME_ID."
exit 1
fi
echo "Found iOS Simulator Runtime: $RUNTIME_ID"
echo "Found iOS Simulator Device UDID: $DEVICE_ID"
echo "SIMULATOR_DESTINATION=platform=iOS Simulator,id=$DEVICE_ID" >> $GITHUB_OUTPUT

- name: Build and Test (${{ matrix.config }})
run: |
echo "Using simulator destination: ${{ steps.find_simulator.outputs.SIMULATOR_DESTINATION }}"
xcodebuild build -scheme NotchMyProblem -sdk $(xcrun --sdk iphonesimulator --show-sdk-path) -destination "${{ steps.find_simulator.outputs.SIMULATOR_DESTINATION }}" SWIFT_VERSION=6.0
6 changes: 3 additions & 3 deletions Examples/NotchMyProblemDemo/ContentView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -74,14 +74,14 @@ struct ContentView: View {
.padding()

// Buttons positioned around the notch/island
TopologyButtonsView(
leadingButton: {
CutoutAccessoryView(
leadingContent: {
Button(action: { }) {
Image(systemName: "arrow.left")
.modifier(ButtonStyleModifier())
}
},
trailingButton: {
trailingContent: {
Button(action: { }) {
Text("Done")
.modifier(ButtonStyleModifier())
Expand Down
Loading
Loading