From 0a6d1939878a99ce763a4d06f5e174a551df757a Mon Sep 17 00:00:00 2001 From: Takis Kakalis <80459599+Takaros999@users.noreply.github.com> Date: Fri, 22 May 2026 11:28:03 +0300 Subject: [PATCH] fix(ci): verify swift ios platform before build --- .github/workflows/ci.yml | 27 +++++++++++++++++---------- 1 file changed, 17 insertions(+), 10 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index d9935f19..6870afaa 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -164,24 +164,31 @@ jobs: working-directory: swift run: set -o pipefail; xcodebuild test -scheme IDKit -destination "platform=macOS" | xcbeautify - - name: Check Swift sample app destinations - id: check-destinations + - name: Check Swift sample app iOS platform + id: check-ios-platform run: | xcodebuild -version - DESTINATIONS=$(xcodebuild -showdestinations \ + xcodebuild -showdestinations \ -project swift/Examples/IDKitSampleApp/IDKitSampleApp.xcodeproj \ - -scheme IDKitSampleApp 2>&1) - echo "$DESTINATIONS" - if echo "$DESTINATIONS" | grep -q "Available destinations"; then - echo "has_destinations=true" >> $GITHUB_OUTPUT + -scheme IDKitSampleApp 2>&1 || true + + IOS_PLATFORM_CHECK_LOG="${RUNNER_TEMP:-/tmp}/ios-platform-check.log" + if xcodebuild \ + -project swift/Examples/IDKitSampleApp/IDKitSampleApp.xcodeproj \ + -scheme IDKitSampleApp \ + -sdk iphoneos \ + -destination "generic/platform=iOS" \ + -showBuildSettings > "$IOS_PLATFORM_CHECK_LOG" 2>&1; then + echo "ios_platform_ready=true" >> $GITHUB_OUTPUT else - echo "has_destinations=false" >> $GITHUB_OUTPUT - echo "No available destinations — skipping build" + cat "$IOS_PLATFORM_CHECK_LOG" + echo "ios_platform_ready=false" >> $GITHUB_OUTPUT + echo "iOS platform is unavailable; downloading platform before build" fi - name: Download iOS platform - if: steps.check-destinations.outputs.has_destinations == 'false' + if: steps.check-ios-platform.outputs.ios_platform_ready == 'false' run: xcodebuild -downloadPlatform iOS - name: Build Swift sample app for iOS