Skip to content

Commit 52099a1

Browse files
authored
🧪 Updates the script to use the latest stable version of iOS available (#940)
1 parent 257132d commit 52099a1

File tree

2 files changed

+17
-5
lines changed

2 files changed

+17
-5
lines changed

‎.github/workflows/build-and-test.yml

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -26,9 +26,16 @@ jobs:
2626
- name: Print available simulators
2727
run: xcrun simctl list devices | cat
2828

29+
- name: Get latest stable iOS version
30+
id: ios-version
31+
run: |
32+
LATEST_IOS=$(xcrun simctl list runtimes | grep "iOS 18" | grep -v "watchOS" | grep -v "beta" | grep -v "Beta" | tail -1 | sed 's/.*iOS \([0-9]*\.[0-9]*\).*/\1/')
33+
echo "version=$LATEST_IOS" >> $GITHUB_OUTPUT
34+
echo "Latest stable iOS version: $LATEST_IOS"
35+
2936
- name: Build and test
3037
run: |
31-
xcodebuild test -project swift-sdk.xcodeproj -scheme swift-sdk -sdk iphonesimulator -destination 'platform=iOS Simulator,name=iPhone 16 Pro,OS=18.2' -enableCodeCoverage YES -resultBundlePath TestResults.xcresult CODE_SIGNING_REQUIRED=NO | xcpretty && exit ${PIPESTATUS[0]}
38+
xcodebuild test -project swift-sdk.xcodeproj -scheme swift-sdk -sdk iphonesimulator -destination 'platform=iOS Simulator,name=iPhone 16 Pro,OS=${{ steps.ios-version.outputs.version }}' -enableCodeCoverage YES -resultBundlePath TestResults.xcresult CODE_SIGNING_REQUIRED=NO | xcpretty && exit ${PIPESTATUS[0]}
3239
3340
- name: Process test results
3441
run: |
@@ -106,6 +113,7 @@ jobs:
106113
run: pod lib lint --allow-warnings
107114

108115
- name: Upload coverage report to codecov.io
109-
env:
110-
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
111-
run: bash <(curl -s https://codecov.io/bash) -X gcov -J 'IterableSDK' -J 'IterableAppExtensions' -B main -C ${{ github.sha }} -r ${{ github.repository }}
116+
uses: codecov/[email protected]
117+
with:
118+
token: ${{ secrets.CODECOV_TOKEN }}
119+
slug: Iterable/iterable-swift-sdk

‎tests/endpoint-tests/scripts/run_test.sh

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,13 @@ sed -e "s/\(apiKey = \).*$/\1\"$api_key\"/" \
2020
-e "s/\(inAppCampaignId = \).*$/\1\NSNumber($in_app_campaign_id)/" \
2121
-e "s/\(inAppTemplateId = \).*$/\1\NSNumber($in_app_template_id)/" $e2e_folder/CI.swift.template > $e2e_folder/CI.swift
2222

23+
echo "Detecting latest stable iOS version..."
24+
LATEST_IOS=$(xcrun simctl list runtimes | grep "iOS 18" | grep -v "watchOS" | grep -v "beta" | grep -v "Beta" | tail -1 | sed 's/.*iOS \([0-9]*\.[0-9]*\).*/\1/')
25+
echo "Using iOS version: $LATEST_IOS"
26+
2327
xcodebuild -project swift-sdk.xcodeproj \
2428
-scheme endpoint-tests \
2529
-sdk iphonesimulator \
26-
-destination 'platform=iOS Simulator,OS=18.1,name=iPhone 16 Pro' \
30+
-destination "platform=iOS Simulator,OS=$LATEST_IOS,name=iPhone 16 Pro" \
2731
-resultBundlePath TestResults.xcresult \
2832
test | xcpretty

0 commit comments

Comments
 (0)