fix: Use run-tests.sh in iOS CI for Swift Testing support

- Replace xcodebuild test with run-tests.sh script
- The script properly handles Swift Testing framework
- Remove xcresult bundle upload as it's not produced by the script
This commit is contained in:
Peter Steinberger 2025-06-22 08:33:39 +02:00
parent c33c9ac729
commit e33a6f9841

View file

@ -204,30 +204,16 @@ jobs:
- name: Run iOS tests - name: Run iOS tests
run: | run: |
cd ios cd ios
echo "Running iOS tests on simulator..." echo "Running iOS tests using Swift Testing framework..."
# First, list available simulators # Use the provided test script which handles Swift Testing properly
xcrun simctl list devices available | grep iPhone | head -5 chmod +x run-tests.sh
./run-tests.sh || {
# Run tests with a more flexible destination echo "::error::iOS tests failed"
xcodebuild test \
-project VibeTunnel.xcodeproj \
-scheme VibeTunnel \
-destination "platform=iOS Simulator,name=iPhone 16 Pro" \
-configuration Debug \
-derivedDataPath build/DerivedData \
-resultBundlePath TestResults.xcresult || {
echo "Test failed. Checking for test results..."
if [ -d "TestResults.xcresult" ]; then
echo "Extracting test results..."
xcrun xcresulttool get --path TestResults.xcresult --format json | jq '.issues.testFailureSummaries[]' || true
fi
exit 1 exit 1
} }
- name: Upload test results - name: Upload test logs on failure
uses: actions/upload-artifact@v4 if: failure()
if: always() run: |
with: echo "Tests failed. Check the logs above for details."
name: ios-test-results # Swift Testing doesn't produce xcresult bundles with run-tests.sh
path: ios/TestResults.xcresult
retention-days: 7