Skip to content

Commit 545af9e

Browse files
Test 53 of CI xlarge
1 parent 900f7c8 commit 545af9e

File tree

1 file changed

+94
-88
lines changed

1 file changed

+94
-88
lines changed

.github/workflows/ios-simulator-tests.yml

Lines changed: 94 additions & 88 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ jobs:
1313
# This supports up to iOS 18.5 Simulator + iOS 26.0
1414
# https://github.com/actions/runner-images/blob/main/images/macos/macos-15-Readme.md
1515
# https://github.com/actions/runner-images/issues/3239
16-
runs-on: self-hosted
16+
runs-on: macos-15-xlarge
1717

1818
steps:
1919
# - name: List available simulator runtimes (1/2)
@@ -38,92 +38,98 @@ jobs:
3838
# xcodebuild -project personalized-news-feed.xcodeproj -list
3939
# xcodebuild -project personalized-news-feed.xcodeproj -showBuildSettings -scheme personalized-news-feed | grep IPHONEOS_DEPLOYMENT_TARGET
4040

41-
- name: Create and Boot iOS Simulator
42-
id: create-simulator
43-
run: |
44-
SIMULATOR_NAME="hapns-test-iphone"
45-
DEVICE_TYPE="com.apple.CoreSimulator.SimDeviceType.iPhone-15-Pro"
46-
RUNTIME="com.apple.CoreSimulator.SimRuntime.iOS-18-5"
47-
48-
echo "🛠️ Creating simulator: $SIMULATOR_NAME"
49-
UDID=$(xcrun simctl create "$SIMULATOR_NAME" "$DEVICE_TYPE" "$RUNTIME")
50-
echo "✅ Simulator created (uuid: '$UDID')"
51-
52-
echo "🛠️ Booting simulator: $SIMULATOR_NAME ($UDID)"
53-
xcrun simctl boot "$UDID"
54-
echo "✅ Simulator booted."
55-
56-
echo "udid=$UDID" >> $GITHUB_OUTPUT
57-
echo "simulator-name=$SIMULATOR_NAME" >> $GITHUB_OUTPUT
58-
59-
- name: Set Simulator Language and Locale
60-
run: |
61-
UDID="${{ steps.create-simulator.outputs.udid }}"
62-
LANGUAGE="en"
63-
LOCALE="en_US"
64-
65-
echo "🛠️ Setting simulator language to '$LANGUAGE' and locale to '$LOCALE'..."
66-
xcrun simctl spawn "$UDID" defaults write "Apple Global Domain" AppleLanguages -array "$LANGUAGE"
67-
xcrun simctl spawn "$UDID" defaults write "Apple Global Domain" AppleLocale -string "$LOCALE"
68-
xcrun simctl spawn "$UDID" launchctl stop com.apple.SpringBoard
69-
echo "✅ Simulator language set."
70-
71-
- name: Checkout repository
72-
uses: actions/checkout@v3
73-
74-
- name: Build iOS App
75-
run: |
76-
UDID="${{ steps.create-simulator.outputs.udid }}"
77-
PROJECT_PATH="examples/AlertNotification-example/ios-app/personalized-news-feed/personalized-news-feed.xcodeproj"
78-
SCHEME="personalized-news-feed"
79-
80-
echo "🛠️ Building scheme '$SCHEME' for simulator..."
81-
xcodebuild clean build-for-testing \
82-
-project "$PROJECT_PATH" \
83-
-scheme "$SCHEME" \
84-
-sdk iphonesimulator \
85-
-destination platform="iOS Simulator,id=$UDID" \
86-
-configuration Debug \
87-
-verbose
88-
89-
echo "🎉 Build completed successfully."
90-
91-
- name: Setup pnpm
92-
uses: pnpm/action-setup@v2
41+
- name: Check if required ports are open
42+
uses: nrukavkov/open-ports-check-action@v1
9343
with:
94-
version: latest
44+
port: 5223, 443, 80
45+
host: "api.sandbox.push.apple.com"
9546

96-
- name: Setup Node.js
97-
uses: actions/setup-node@v4
98-
with:
99-
node-version: "22"
100-
cache: "pnpm"
47+
# - name: Create and Boot iOS Simulator
48+
# id: create-simulator
49+
# run: |
50+
# SIMULATOR_NAME="hapns-test-iphone"
51+
# DEVICE_TYPE="com.apple.CoreSimulator.SimDeviceType.iPhone-15-Pro"
52+
# RUNTIME="com.apple.CoreSimulator.SimRuntime.iOS-18-5"
53+
54+
# echo "🛠️ Creating simulator: $SIMULATOR_NAME"
55+
# UDID=$(xcrun simctl create "$SIMULATOR_NAME" "$DEVICE_TYPE" "$RUNTIME")
56+
# echo "✅ Simulator created (uuid: '$UDID')"
57+
58+
# echo "🛠️ Booting simulator: $SIMULATOR_NAME ($UDID)"
59+
# xcrun simctl boot "$UDID"
60+
# echo "✅ Simulator booted."
61+
62+
# echo "udid=$UDID" >> $GITHUB_OUTPUT
63+
# echo "simulator-name=$SIMULATOR_NAME" >> $GITHUB_OUTPUT
10164

102-
- name: Install dependencies
103-
run: pnpm install
65+
# - name: Set Simulator Language and Locale
66+
# run: |
67+
# UDID="${{ steps.create-simulator.outputs.udid }}"
68+
# LANGUAGE="en"
69+
# LOCALE="en_US"
10470

105-
- name: Build the project
106-
run: pnpm run build
71+
# echo "🛠️ Setting simulator language to '$LANGUAGE' and locale to '$LOCALE'..."
72+
# xcrun simctl spawn "$UDID" defaults write "Apple Global Domain" AppleLanguages -array "$LANGUAGE"
73+
# xcrun simctl spawn "$UDID" defaults write "Apple Global Domain" AppleLocale -string "$LOCALE"
74+
# xcrun simctl spawn "$UDID" launchctl stop com.apple.SpringBoard
75+
# echo "✅ Simulator language set."
10776

108-
# - name: Download iOS Simulator
109-
# run: xcodebuild -downloadPlatform iOS -arch arm64
77+
# - name: Checkout repository
78+
# uses: actions/checkout@v3
11079

111-
- name: Start test server
112-
run: |
113-
echo "Starting test server..."
114-
node specs/server/server.mjs > server.log 2>&1 &
115-
echo $! > server.pid
80+
# - name: Build iOS App
81+
# run: |
82+
# UDID="${{ steps.create-simulator.outputs.udid }}"
83+
# PROJECT_PATH="examples/AlertNotification-example/ios-app/personalized-news-feed/personalized-news-feed.xcodeproj"
84+
# SCHEME="personalized-news-feed"
85+
86+
# echo "🛠️ Building scheme '$SCHEME' for simulator..."
87+
# xcodebuild clean build-for-testing \
88+
# -project "$PROJECT_PATH" \
89+
# -scheme "$SCHEME" \
90+
# -sdk iphonesimulator \
91+
# -destination platform="iOS Simulator,id=$UDID" \
92+
# -configuration Debug \
93+
# -verbose
94+
95+
# echo "🎉 Build completed successfully."
96+
97+
# - name: Setup pnpm
98+
# uses: pnpm/action-setup@v2
99+
# with:
100+
# version: latest
101+
102+
# - name: Setup Node.js
103+
# uses: actions/setup-node@v4
104+
# with:
105+
# node-version: "22"
106+
# cache: "pnpm"
116107

117-
- name: Run End-to-End iOS Simulator Tests
118-
# env:
119-
# APNS_TOKEN_KEY: ${{ secrets.APNS_TOKEN_KEY }}
120-
run: pnpm run test
108+
# - name: Install dependencies
109+
# run: pnpm install
121110

122-
- name: Print server logs on failure
123-
if: failure()
124-
run: |
125-
echo "Dumping server logs..."
126-
cat server.log
111+
# - name: Build the project
112+
# run: pnpm run build
113+
114+
# # - name: Download iOS Simulator
115+
# # run: xcodebuild -downloadPlatform iOS -arch arm64
116+
117+
# - name: Start test server
118+
# run: |
119+
# echo "Starting test server..."
120+
# node specs/server/server.mjs > server.log 2>&1 &
121+
# echo $! > server.pid
122+
123+
# - name: Run End-to-End iOS Simulator Tests
124+
# # env:
125+
# # APNS_TOKEN_KEY: ${{ secrets.APNS_TOKEN_KEY }}
126+
# run: pnpm run test
127+
128+
# - name: Print server logs on failure
129+
# if: failure()
130+
# run: |
131+
# echo "Dumping server logs..."
132+
# cat server.log
127133

128134
# - name: Retrieve and Print Test Logs on Failure (1/2)
129135
# if: failure()
@@ -159,12 +165,12 @@ jobs:
159165
# echo "Could not find .app bundle to verify entitlements."
160166
# fi
161167

162-
- name: Cleanup
163-
if: always()
164-
run: |
165-
echo "Cleaning up..."
166-
if [ -f server.pid ]; then
167-
echo "Stopping test server..."
168-
kill $(cat server.pid) || true
169-
rm server.pid
170-
fi
168+
# - name: Cleanup
169+
# if: always()
170+
# run: |
171+
# echo "Cleaning up..."
172+
# if [ -f server.pid ]; then
173+
# echo "Stopping test server..."
174+
# kill $(cat server.pid) || true
175+
# rm server.pid
176+
# fi

0 commit comments

Comments
 (0)