Skip to content

Commit 57d35fc

Browse files
committed
Updated github workflows to use script to get iPhone simulator and new checkout@v4
1 parent c64cae2 commit 57d35fc

File tree

2 files changed

+12
-4
lines changed

2 files changed

+12
-4
lines changed

.github/workflows/build-test.yml

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,12 @@ jobs:
1414

1515
steps:
1616
- name: Checkout Repository
17-
uses: actions/checkout@v3
17+
uses: actions/checkout@v4
1818
- name: Install
1919
run: pod install
2020
- name: Build & Test
21-
run: xcodebuild test -workspace sf-ios.xcworkspace -scheme sf-ios -destination 'platform=iOS Simulator,OS=latest,name=iPhone 16'
21+
run:
22+
iphone_names=$(xcrun simctl list devices available --json | jq -r '.devices | to_entries[] | .value[] | select(.name | test("^iPhone [0-9]+")) | .name')
23+
latest_iphone=$(echo "$iphone_names" | sort | tail -n 1)
24+
echo "latest_iphone: $latest_iphone"
25+
xcodebuild test -workspace sf-ios.xcworkspace -scheme sf-ios -destination "platform=iOS Simulator,OS=latest,name=$latest_iphone"

.github/workflows/build.yml

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,12 @@ jobs:
1313

1414
steps:
1515
- name: Checkout Repository
16-
uses: actions/checkout@v3
16+
uses: actions/checkout@v4
1717
- name: Install
1818
run: pod install
1919
- name: Build
20-
run: xcodebuild build-for-testing -workspace sf-ios.xcworkspace -scheme sf-ios -destination 'platform=iOS Simulator,OS=latest,name=iPhone 16'
20+
run: |
21+
iphone_names=$(xcrun simctl list devices available --json | jq -r '.devices | to_entries[] | .value[] | select(.name | test("^iPhone [0-9]+")) | .name')
22+
latest_iphone=$(echo "$iphone_names" | sort | tail -n 1)
23+
echo "latest_iphone: $latest_iphone"
24+
xcodebuild build-for-testing -workspace sf-ios.xcworkspace -scheme sf-ios -destination "platform=iOS Simulator,OS=latest,name=$latest_iphone"

0 commit comments

Comments
 (0)