25
25
swiftui-auth :
26
26
runs-on : macOS-latest
27
27
timeout-minutes : 30
28
+ env :
29
+ SIMULATOR_NAME : CI-iPhone-16-Test
28
30
steps :
29
31
- uses : actions/checkout@d632683dd7b4114ad314bca15554477dd762a938
30
32
- uses : actions/setup-node@1d0ff469b7ec7b3cb9d8673fde0c81c44821de2a
@@ -46,19 +48,24 @@ jobs:
46
48
- name : Select Xcode version
47
49
run : |
48
50
sudo xcode-select -switch /Applications/Xcode_16.1.app/Contents/Developer
49
- - name : Boot Simulator (once) to create plist
51
+ - name : Create Simulator
52
+ run : xcrun simctl create "$SIMULATOR_NAME" "iPhone 16 Plus" latest
53
+ - name : Boot Simulator Once and Generate Preferences
50
54
run : |
51
- xcrun simctl boot "iPhone 16 Plus" || true
55
+ xcrun simctl boot "$SIMULATOR_NAME"
52
56
sleep 5
53
- # needed for SecureFields otherwise the UI flow tests will fail
54
- - name : Disable iOS Simulator hardware keyboard & kill to force reload
57
+ open -a Simulator
58
+ sleep 10
59
+ osascript -e 'tell application "Simulator" to quit'
60
+
61
+ - name : Disable iOS Simulator Hardware Keyboard
55
62
run : |
56
- /usr/libexec/PlistBuddy -c "Add :ConnectHardwareKeyboard bool false" ~/Library/Preferences/com.apple.iphonesimulator.plist || \
57
- /usr/libexec/PlistBuddy -c "Set :ConnectHardwareKeyboard false" ~/Library/Preferences/com.apple.iphonesimulator.plist
58
- killall Simulator || true
59
- - name : Confirm Simulator keyboard setting
63
+ defaults write com.apple.iphonesimulator ConnectHardwareKeyboard -bool false
64
+
65
+ - name : Boot Simulator for Testing
60
66
run : |
61
- /usr/libexec/PlistBuddy -c "Print :ConnectHardwareKeyboard" ~/Library/Preferences/com.apple.iphonesimulator.plist || echo "Key not found"
67
+ xcrun simctl boot "$SIMULATOR_NAME"
68
+ sleep 5
62
69
- name : Run Integration Tests
63
70
run : |
64
71
cd ./samples/swiftui/FirebaseSwiftUIExample
68
75
run : |
69
76
cd ./samples/swiftui/FirebaseSwiftUIExample
70
77
set -o pipefail
71
- xcodebuild test -scheme FirebaseSwiftUIExampleUITests -destination 'platform=iOS Simulator, name=iPhone 16 Plus' -enableCodeCoverage YES | tee FirebaseSwiftUIExampleUITests.log | xcpretty --test --color --simple
78
+ xcodebuild test -scheme FirebaseSwiftUIExampleUITests -destination " name=$SIMULATOR_NAME" -enableCodeCoverage YES | tee FirebaseSwiftUIExampleUITests.log | xcpretty --test --color --simple
72
79
- name : Upload test logs
73
80
if : always()
74
81
uses : actions/upload-artifact@v4
0 commit comments