diff --git a/.github/workflows/test-cross-platform.yml b/.github/workflows/test-cross-platform.yml index ba93bbc47c..df15330ebe 100644 --- a/.github/workflows/test-cross-platform.yml +++ b/.github/workflows/test-cross-platform.yml @@ -75,7 +75,8 @@ jobs: timeout-minutes: 5 # 5 minutes timeout env: OS_VERSION: "18.4" - run: ./sentry-cocoa/scripts/ci-ensure-runtime-loaded.sh --os-version "$OS_VERSION" + PLATFORM: "iOS" + run: ./sentry-cocoa/scripts/ci-ensure-runtime-loaded.sh --os-version "$OS_VERSION" --platform "$PLATFORM" - name: Create simulator device for iOS 18.4 run: ./sentry-cocoa/scripts/ci-create-simulator.sh --platform "iOS" --os-version "18.4" --device-name "iPhone 15 Pro" diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 6f3dafea4d..f244a85ad2 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -118,6 +118,13 @@ jobs: --remove-duplicate true \ --change-path false \ --remove-binary-targets true + - name: Ensure required runtime is loaded + # Ideally we will not need this, but CI sometimes is failing to load some runtimes, this will ensure they are loaded + timeout-minutes: 5 # 5 minutes timeout + env: + OS_VERSION: "18.4" + PLATFORM: "iOS" + run: ./scripts/ci-ensure-runtime-loaded.sh --os-version "$OS_VERSION" --platform "$PLATFORM" - run: rm -r Sentry.xcodeproj && rm -r Sentry.xcworkspace - run: set -o pipefail && NSUnbufferedIO=YES SKIP_BINARIES=1 xcodebuild test -scheme Sentry-Package -sdk iphonesimulator -destination 'platform=iOS Simulator,OS=18.4,name=iPhone 16 Pro' | tee raw-test-output-distribution.log | xcbeautify --preserve-unbeautified shell: sh diff --git a/.github/workflows/ui-tests-common.yml b/.github/workflows/ui-tests-common.yml index 4179981f1a..682d6a0a4b 100644 --- a/.github/workflows/ui-tests-common.yml +++ b/.github/workflows/ui-tests-common.yml @@ -110,12 +110,13 @@ jobs: run: ./scripts/ci-install-platforms.sh --platforms "$PLATFORM" --os-version "$OS_VERSION" - name: Ensure required runtime is loaded + if: ${{ inputs.platform == 'iOS' || inputs.platform == 'tvOS' }} # Ideally we will not need this, but CI sometimes is failing to load some runtimes, this will ensure they are loaded - if: ${{ inputs.platform == 'iOS' }} timeout-minutes: 5 # 5 minutes timeout env: OS_VERSION: ${{ inputs.test-destination-os }} - run: ./scripts/ci-ensure-runtime-loaded.sh --os-version "$OS_VERSION" + PLATFORM: ${{ inputs.platform }} + run: ./scripts/ci-ensure-runtime-loaded.sh --os-version "$OS_VERSION" --platform "$PLATFORM" - name: Create simulator device if: ${{ inputs.create_device }} diff --git a/.github/workflows/ui-tests-critical.yml b/.github/workflows/ui-tests-critical.yml index e6400eb66f..c0206c7ca1 100644 --- a/.github/workflows/ui-tests-critical.yml +++ b/.github/workflows/ui-tests-critical.yml @@ -107,7 +107,8 @@ jobs: timeout-minutes: 5 # 5 minutes timeout env: OS_VERSION: "18.4" - run: ./scripts/ci-ensure-runtime-loaded.sh --os-version "$OS_VERSION" + PLATFORM: "iOS" + run: ./scripts/ci-ensure-runtime-loaded.sh --os-version "$OS_VERSION" --platform "$PLATFORM" - name: Boot simulator run: ./scripts/ci-boot-simulator.sh diff --git a/.github/workflows/unit-test-common.yml b/.github/workflows/unit-test-common.yml index 39326849bf..23de5f1016 100644 --- a/.github/workflows/unit-test-common.yml +++ b/.github/workflows/unit-test-common.yml @@ -93,12 +93,13 @@ jobs: run: ./scripts/ci-install-platforms.sh --platforms "$PLATFORMS" --os-version "$OS_VERSION" - name: Ensure required runtime is loaded + if: ${{ inputs.platform == 'iOS' || inputs.platform == 'tvOS' || inputs.platform == 'visionOS' }} # Ideally we will not need this, but CI sometimes is failing to load some runtimes, this will ensure they are loaded - if: ${{ inputs.platform == 'iOS' }} timeout-minutes: 5 # 5 minutes timeout env: OS_VERSION: ${{ inputs.test-destination-os }} - run: ./scripts/ci-ensure-runtime-loaded.sh --os-version "$OS_VERSION" + PLATFORM: ${{ inputs.platform }} + run: ./scripts/ci-ensure-runtime-loaded.sh --os-version "$OS_VERSION" --platform "$PLATFORM" # Create simulator devices for non-preinstalled simulators # Required for iOS 16.4, iOS 17.5 (on Xcode 15.4), and iOS/tvOS 26.1 diff --git a/scripts/ci-ensure-runtime-loaded.sh b/scripts/ci-ensure-runtime-loaded.sh index 4f478a5005..18db11980a 100755 --- a/scripts/ci-ensure-runtime-loaded.sh +++ b/scripts/ci-ensure-runtime-loaded.sh @@ -9,11 +9,13 @@ set -euo pipefail # Parse named arguments OS_VERSION="" +PLATFORM="" usage() { - echo "Usage: $0 --os-version " + echo "Usage: $0 --os-version --platform " echo " OS version: Version to ensure is loaded (e.g., 26.1 for beta, 16.4 for older iOS)" - echo " Example: $0 --os-version 26.1" + echo " Platform: Platform to ensure is loaded (e.g., iOS, tvOS, visionOS)" + echo " Example: $0 --os-version 26.1 --platform iOS" echo " Example: $0 --os-version 16.4" exit 1 } @@ -24,6 +26,10 @@ while [[ $# -gt 0 ]]; do OS_VERSION="$2" shift 2 ;; + --platform) + PLATFORM="$2" + shift 2 + ;; *) echo "Unknown argument: $1" usage @@ -36,15 +42,20 @@ if [ -z "$OS_VERSION" ]; then usage fi -echo "Ensuring runtime $OS_VERSION is loaded" +if [ -z "$PLATFORM" ]; then + echo "Error: --platform argument is required" + usage +fi + +echo "Ensuring runtime $PLATFORM ($OS_VERSION) is loaded" # Check if the runtime is loaded -if xcrun simctl list runtimes -v | grep -qE "iOS $OS_VERSION" && ! xcrun simctl list runtimes -v | grep -qE "iOS $OS_VERSION.*unavailable" ; then +if xcrun simctl list runtimes -v | grep -qE "$PLATFORM $OS_VERSION" && ! xcrun simctl list runtimes -v | grep -qE "$PLATFORM $OS_VERSION.*unavailable" ; then echo "Runtime $OS_VERSION is loaded" exit 0 fi -echo "Runtime $OS_VERSION is not loaded, will try to load it" +echo "Runtime $PLATFORM ($OS_VERSION) is not loaded, will try to load it" # Unmount simulator volumes once before checking for dir in /Library/Developer/CoreSimulator/Volumes/*; do @@ -58,7 +69,7 @@ sudo pkill -9 com.apple.CoreSimulator.CoreSimulatorService || true count=0 MAX_ATTEMPTS=60 # 300 seconds (5 minutes) timeout while [ $count -lt $MAX_ATTEMPTS ]; do - if xcrun simctl list runtimes -v | grep -qE "iOS $OS_VERSION" && ! xcrun simctl list runtimes -v | grep -qE "iOS $OS_VERSION.*unavailable"; then + if xcrun simctl list runtimes -v | grep -qE "$PLATFORM $OS_VERSION" && ! xcrun simctl list runtimes -v | grep -qE "$PLATFORM $OS_VERSION.*unavailable"; then echo "Runtime $OS_VERSION is loaded after $count attempts" exit 0 fi @@ -67,5 +78,5 @@ while [ $count -lt $MAX_ATTEMPTS ]; do sleep 5 done -echo "Runtime $OS_VERSION is not loaded after $count attempts" +echo "Runtime $PLATFORM ($OS_VERSION) is not loaded after $count attempts" exit 1