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 || {
echo "::error::iOS tests failed"
exit 1
}
# Run tests with a more flexible destination - name: Upload test logs on failure
xcodebuild test \ if: failure()
-project VibeTunnel.xcodeproj \ run: |
-scheme VibeTunnel \ echo "Tests failed. Check the logs above for details."
-destination "platform=iOS Simulator,name=iPhone 16 Pro" \ # Swift Testing doesn't produce xcresult bundles with run-tests.sh
-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
}
- name: Upload test results
uses: actions/upload-artifact@v4
if: always()
with:
name: ios-test-results
path: ios/TestResults.xcresult
retention-days: 7