@@ -6,25 +6,24 @@ concurrency:
66jobs :
77 unit_test_job :
88 name : Unit
9- runs-on : macOS-14 -xlarge
9+ runs-on : macos-15 -xlarge
1010 steps :
1111 - name : Checkout repository
1212 uses : actions/checkout@v4
1313 with :
1414 ref : ${{ github.event.pull_request.head.ref }}
1515 repository : ${{ github.event.pull_request.head.repo.full_name }}
16- - name : Use Xcode 15.0.1
17- run : sudo xcode-select -switch /Applications/Xcode_15.0.1 .app
16+ - name : Use Xcode 16.4
17+ run : sudo xcode-select -switch /Applications/Xcode_16.4.0 .app
1818 - name : Install Package dependencies
1919 run : swift package resolve
2020 - name : Install CocoaPod dependencies
2121 run : pod install
2222 - name : Run Unit Tests
23- run : set -o pipefail && xcodebuild -workspace 'Braintree.xcworkspace' -sdk 'iphonesimulator' -configuration 'Debug' -scheme 'UnitTests' -destination 'platform=iOS Simulator,name=iPhone 15' test | ./Pods/xcbeautify/xcbeautify
24-
23+ run : set -o pipefail && xcodebuild -workspace 'Braintree.xcworkspace' -sdk 'iphonesimulator' -configuration 'Debug' -scheme 'UnitTests' -destination 'name=iPhone 16 Pro,OS=18.5,platform=iOS Simulator' -derivedDataPath DerivedData test | ./Pods/xcbeautify/xcbeautify
2524 ui_test_job :
2625 name : UI
27- runs-on : macOS-14 -xlarge
26+ runs-on : macos-15 -xlarge
2827 timeout-minutes : 20 # Add overall job timeout
2928 strategy :
3029 matrix :
3332 - PayPal_Checkout_UITests
3433 - PayPal_Vault_UITests
3534 - Venmo_UITests
35+ - PayPalMessaging_Failure_UITests
36+ - PayPalMessaging_Success_UITests
3637 fail-fast : false # Continue running other test suites if one fails
3738 steps :
3839 - name : Checkout repository
@@ -41,93 +42,83 @@ jobs:
4142 ref : ${{ github.event.pull_request.head.ref }}
4243 repository : ${{ github.event.pull_request.head.repo.full_name }}
4344
44- - name : Use Xcode 15.0.1
45- run : sudo xcode-select -switch /Applications/Xcode_15.0.1 .app
45+ - name : Use Xcode 16.4
46+ run : sudo xcode-select -switch /Applications/Xcode_16.4.0 .app
4647
4748 - name : Install CocoaPod dependencies
4849 run : pod install
4950
5051 - name : Boot Simulator
5152 run : |
5253 # Boot simulator ahead of time to reduce test startup time
53- xcrun simctl boot "iPhone 15" || true
54- # Wait for simulator to boot
55- xcrun simctl bootstatus "iPhone 15" -b || true
54+ # Find iPhone 16 Pro with iOS 18.5
55+ DEVICE_UDID=$(xcrun simctl list devices | grep -A 1 "iOS 18.5" | grep "iPhone 16 Pro (" | head -n 1 | grep -oE '\([A-Z0-9-]+\)' | tr -d '()')
56+
57+ if [ -n "$DEVICE_UDID" ]; then
58+ xcrun simctl boot "$DEVICE_UDID" || true
59+ xcrun simctl bootstatus "$DEVICE_UDID" -b || true
60+ fi
5661 # Disable hardware keyboard to avoid input issues
5762 defaults write com.apple.iphonesimulator ConnectHardwareKeyboard -bool false
5863
5964 - name : Clean Simulator State
65+ timeout-minutes : 3
6066 run : |
6167 # Reset simulator state to ensure clean environment
62- xcrun simctl shutdown all || true
63- xcrun simctl erase all || true
64- xcrun simctl boot "iPhone 15" || true
65- xcrun simctl bootstatus "iPhone 15" -b || true
68+ echo "Finding iPhone 16 Pro (iOS 18.5) simulator..."
69+ DEVICE_UDID=$(xcrun simctl list devices | grep -A 1 "iOS 18.5" | grep "iPhone 16 Pro (" | head -n 1 | grep -oE '\([A-Z0-9-]+\)' | tr -d '()')
6670
67- - name : Run UI Tests - ${{ matrix.test-suite }}
68- id : test_attempt_1
69- continue-on-error : true
70- run : |
71- set -o pipefail
72- xcodebuild \
73- -workspace 'Braintree.xcworkspace' \
74- -sdk 'iphonesimulator' \
75- -configuration 'Release' \
76- -scheme 'UITests' \
77- -destination 'name=iPhone 15,OS=17.2,platform=iOS Simulator' \
78- -only-testing:UITests/${{ matrix.test-suite }} \
79- -maximum-concurrent-test-simulator-destinations 1 \
80- -disable-concurrent-testing \
81- test | ./Pods/xcbeautify/xcbeautify
71+ if [ -z "$DEVICE_UDID" ]; then
72+ echo "::error::iPhone 16 Pro (iOS 18.5) simulator not found"
73+ exit 1
74+ fi
8275
83- - name : Retry UI Tests (if failed) - ${{ matrix.test-suite }}
84- if : steps.test_attempt_1.outcome == 'failure'
85- id : test_attempt_2
86- continue-on-error : true
87- run : |
88- echo "First attempt failed, retrying..."
89- # Clean simulator state before retry
90- xcrun simctl shutdown all || true
91- xcrun simctl erase all || true
92- xcrun simctl boot "iPhone 15" || true
93- xcrun simctl bootstatus "iPhone 15" -b || true
76+ echo "Using simulator: $DEVICE_UDID"
77+
78+ # Shutdown only the target simulator (not all)
79+ xcrun simctl shutdown "$DEVICE_UDID" 2>/dev/null || true
80+
81+ # Erase only the target simulator
82+ echo "Erasing simulator data..."
83+ xcrun simctl erase "$DEVICE_UDID"
84+
85+ # Boot simulator
86+ echo "Booting simulator..."
87+ xcrun simctl boot "$DEVICE_UDID"
88+
89+ # Wait for boot with timeout (60 seconds)
90+ echo "Waiting for simulator to boot..."
91+ timeout 60 xcrun simctl bootstatus "$DEVICE_UDID" -b || echo "::warning::Boot status check timed out, continuing anyway"
9492
93+ - name : Run UI Tests - ${{ matrix.test-suite }}
94+ run : |
9595 set -o pipefail
9696 xcodebuild \
9797 -workspace 'Braintree.xcworkspace' \
9898 -sdk 'iphonesimulator' \
99- -configuration 'Release ' \
99+ -configuration 'Debug ' \
100100 -scheme 'UITests' \
101- -destination 'name=iPhone 15,OS=17.2,platform=iOS Simulator' \
101+ -destination 'name=iPhone 16 Pro,OS=18.5,platform=iOS Simulator' \
102+ -derivedDataPath DerivedData \
102103 -only-testing:UITests/${{ matrix.test-suite }} \
103- -maximum -concurrent-test-simulator-destinations 1 \
104- -disable-concurrent-testing \
104+ -disable -concurrent-destination-testing \
105+ -retry-tests-on-failure \
105106 test | ./Pods/xcbeautify/xcbeautify
106107
107- - name : Final UI Test Result - ${{ matrix.test-suite }}
108- if : steps.test_attempt_1.outcome == 'failure'
109- run : |
110- if [ "${{ steps.test_attempt_2.outcome }}" == "failure" ]; then
111- echo "UI Tests failed after retry"
112- exit 1
113- else
114- echo "UI Tests passed on retry"
115- fi
116-
117108 integration_test_job :
118109 name : Integration
119- runs-on : macOS-14 -xlarge
110+ runs-on : macos-15 -xlarge
120111 steps :
121112 - name : Checkout repository
122113 uses : actions/checkout@v4
123114 with :
124115 ref : ${{ github.event.pull_request.head.ref }}
125116 repository : ${{ github.event.pull_request.head.repo.full_name }}
126- - name : Use Xcode 15.0.1
127- run : sudo xcode-select -switch /Applications/Xcode_15.0.1 .app
117+ - name : Use Xcode 16.4
118+ run : sudo xcode-select -switch /Applications/Xcode_16.4.0 .app
128119 - name : Install Package dependencies
129120 run : swift package resolve
130121 - name : Install CocoaPod dependencies
131122 run : pod install
132123 - name : Run Integration Tests
133- run : set -o pipefail && xcodebuild -workspace 'Braintree.xcworkspace' -sdk 'iphonesimulator' -configuration 'Release' -scheme 'IntegrationTests' -destination 'name=iPhone 15 ,OS=17.2 ,platform=iOS Simulator' test | ./Pods/xcbeautify/xcbeautify
124+ run : set -o pipefail && xcodebuild -workspace 'Braintree.xcworkspace' -sdk 'iphonesimulator' -configuration 'Release' -scheme 'IntegrationTests' -destination 'name=iPhone 16 Pro ,OS=18.5 ,platform=iOS Simulator' -derivedDataPath DerivedData test | ./Pods/xcbeautify/xcbeautify
0 commit comments