Skip to content

Commit ab95efb

Browse files
ci(SDK-709): pin Xcode 16.4 and iPhone 16 Pro for Swift CodeQL
Match the iOS SDK CI so xcodebuild does not fail with exit 70 when multiple iPhone 16 simulators are present. Co-authored-by: Cursor <cursoragent@cursor.com>
1 parent 879bd6f commit ab95efb

1 file changed

Lines changed: 26 additions & 3 deletions

File tree

‎.github/workflows/codeql.yml‎

Lines changed: 26 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -175,7 +175,29 @@ jobs:
175175
- name: Setup
176176
uses: ./.github/actions/setup
177177

178-
# Initializes the CodeQL tools for scanning.
178+
- uses: maxim-lobanov/setup-xcode@60606e260d2fc5762a71e64e74b2174e8ea3c8bd # v1.6.0
179+
with:
180+
xcode-version: '16.4'
181+
182+
- name: Print available simulators
183+
run: xcrun simctl list devices | cat
184+
185+
- name: Get latest stable iOS version
186+
id: ios-version
187+
run: |
188+
# First try to find iOS 18.x that's available
189+
LATEST_IOS=$(xcrun simctl list runtimes | grep "iOS 18" | grep -v "watchOS" | grep -v "beta" | grep -v "Beta" | grep -v "unavailable" | tail -1 | sed 's/.*iOS \([0-9]*\.[0-9]*\).*/\1/')
190+
191+
# If no iOS 18.x available, fall back to any available iOS version
192+
if [ -z "$LATEST_IOS" ]; then
193+
echo "No iOS 18.x available, falling back to latest available iOS version..."
194+
LATEST_IOS=$(xcrun simctl list runtimes | grep "iOS" | grep -v "watchOS" | grep -v "beta" | grep -v "Beta" | grep -v "unavailable" | tail -1 | sed 's/.*iOS \([0-9]*\.[0-9]*\).*/\1/')
195+
fi
196+
197+
echo "version=$LATEST_IOS" >> $GITHUB_OUTPUT
198+
echo "Latest stable iOS version: $LATEST_IOS"
199+
200+
# Initializes the CodeQL tools for scanning.
179201
- name: Initialize CodeQL
180202
uses: github/codeql-action/init@v4
181203
with:
@@ -188,15 +210,16 @@ jobs:
188210
# For more details on CodeQL's query packs, refer to: https://docs.github.com/en/code-security/code-scanning/automatically-scanning-your-code-for-vulnerabilities-and-errors/configuring-code-scanning#using-queries-in-ql-packs
189211
queries: ${{ matrix.language && 'security-extended, security-and-quality' }}
190212

191-
- if: matrix.build-mode == 'manual'
213+
- name: Build example for CodeQL
214+
if: matrix.build-mode == 'manual'
192215
shell: bash
193216
run: |
194217
cd example
195218
yarn install
196219
cd ios
197220
bundle install
198221
bundle exec pod install
199-
xcodebuild -workspace ReactNativeSdkExample.xcworkspace -scheme ReactNativeSdkExample -configuration Debug -destination 'platform=iOS Simulator,name=iPhone 16' build
222+
xcodebuild -workspace ReactNativeSdkExample.xcworkspace -scheme ReactNativeSdkExample -configuration Debug -destination 'platform=iOS Simulator,name=iPhone 16 Pro,OS=${{ steps.ios-version.outputs.version }}' build
200223
201224
- name: Perform CodeQL Analysis
202225
uses: github/codeql-action/analyze@v4

0 commit comments

Comments
 (0)