|  | 
| 60 | 60 |     - name: Build | 
| 61 | 61 |       run: xcodebuild build -workspace ".swiftpm/xcode/package.xcworkspace" -scheme "TimecodeKit-CI" -destination "generic/platform=iOS Simulator,name=Any iOS Device" | xcpretty && exit ${PIPESTATUS[0]} | 
| 62 | 62 |     - name: Unit Tests | 
| 63 |  | -      run: xcodebuild test -workspace ".swiftpm/xcode/package.xcworkspace" -scheme "TimecodeKit-CI" -destination "platform=iOS Simulator,name=iPhone 15" | xcpretty && exit ${PIPESTATUS[0]} | 
|  | 63 | +      run: destName=$(xcodebuild -showdestinations -workspace ".swiftpm/xcode/package.xcworkspace" -scheme "TimecodeKit-CI" | perl -nle 'if (m/iOS\sSimulator.*(iPhone.*)\s\.*/g) { print $1; }' | head -n 1) | 
|  | 64 | +      run: xcodebuild test -workspace ".swiftpm/xcode/package.xcworkspace" -scheme "TimecodeKit-CI" -destination "platform=iOS Simulator,name=${destName}" | xcpretty && exit ${PIPESTATUS[0]} | 
| 64 | 65 | 
 | 
| 65 | 66 |   tvOS: | 
| 66 | 67 |     name: tvOS | 
|  | 
| 73 | 74 |     - name: Build | 
| 74 | 75 |       run: xcodebuild build -workspace ".swiftpm/xcode/package.xcworkspace" -scheme "TimecodeKit-CI" -destination "generic/platform=tvOS Simulator,name=Any tvOS Simulator Device" | xcpretty && exit ${PIPESTATUS[0]} | 
| 75 | 76 |     - name: Unit Tests | 
| 76 |  | -      run: xcodebuild test -workspace ".swiftpm/xcode/package.xcworkspace" -scheme "TimecodeKit-CI" -destination "platform=tvOS Simulator,name=Apple TV 4K (3rd generation)" | xcpretty && exit ${PIPESTATUS[0]} | 
|  | 77 | +      run: destName=$(xcodebuild -showdestinations -workspace ".swiftpm/xcode/package.xcworkspace" -scheme "TimecodeKit-CI" | perl -nle 'if (m/tvOS\sSimulator.*(Apple\sTV.*)\s\.*/g) { print $1; }' | head -n 1) | 
|  | 78 | +      run: xcodebuild test -workspace ".swiftpm/xcode/package.xcworkspace" -scheme "TimecodeKit-CI" -destination "platform=tvOS Simulator,name=${destName}" | xcpretty && exit ${PIPESTATUS[0]} | 
| 77 | 79 | 
 | 
| 78 | 80 |   watchOS: | 
| 79 | 81 |     name: watchOS | 
|  | 
| 86 | 88 |     - name: Build | 
| 87 | 89 |       run: xcodebuild build -workspace ".swiftpm/xcode/package.xcworkspace" -scheme "TimecodeKit-CI" -destination "generic/platform=watchOS Simulator,name=Any watchOS Simulator Device" | xcpretty && exit ${PIPESTATUS[0]} | 
| 88 | 90 |     - name: Unit Tests | 
| 89 |  | -      run: xcodebuild test -workspace ".swiftpm/xcode/package.xcworkspace" -scheme "TimecodeKit-CI" -destination "platform=watchOS Simulator,name=Apple Watch Series 10 (46mm)" | xcpretty && exit ${PIPESTATUS[0]} | 
|  | 91 | +      run: destName=$(xcodebuild -showdestinations -workspace ".swiftpm/xcode/package.xcworkspace" -scheme "TimecodeKit-CI" | perl -nle 'if (m/watchOS\sSimulator.*(Apple\sWatch.*)\s\.*/g) { print $1; }' | head -n 1) | 
|  | 92 | +      run: xcodebuild test -workspace ".swiftpm/xcode/package.xcworkspace" -scheme "TimecodeKit-CI" -destination "platform=watchOS Simulator,name=${destName}" | xcpretty && exit ${PIPESTATUS[0]} | 
| 90 | 93 | 
 | 
| 91 | 94 |   examples: | 
| 92 | 95 |     name: Examples | 
|  | 
| 95 | 98 |     - uses: actions/checkout@main | 
| 96 | 99 |     - uses: maxim-lobanov/setup-xcode@v1 | 
| 97 | 100 |       with: | 
| 98 |  | -        xcode-version: latest-stable # Sometimes a newer version of Xcode is available but isn't yet made default | 
|  | 101 | +        xcode-version: latest-stable | 
| 99 | 102 | 
 | 
| 100 | 103 |     - name: Movie Timecode - Resolve Package Dependencies # needed because sometimes xcodebuild fails otherwise | 
| 101 | 104 |       run: xcodebuild -project "Examples/Movie Timecode/Movie Timecode.xcodeproj" -resolvePackageDependencies | xcpretty && exit ${PIPESTATUS[0]} | 
|  | 
0 commit comments