From 3b23731fd4c64546c626e3fa3f759a59b97f02b0 Mon Sep 17 00:00:00 2001 From: reeshika-h Date: Fri, 29 Aug 2025 16:24:07 +0530 Subject: [PATCH 1/2] Add patch step for DVR project to support Swift 5 in CI workflow --- .github/workflows/ci.yml | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index b6a2c35..384bd83 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -66,7 +66,17 @@ jobs: uses: ruby/setup-ruby@v1 with: ruby-version: '3.0' - + + - name: Patch DVR project for Xcode + run: | + mkdir -p Carthage/Checkouts + git clone https://github.com/contentstack/contentstack-swift-dvr.git Carthage/Checkouts/contentstack-swift-dvr + cd Carthage/Checkouts/contentstack-swift-dvr + # Force Swift 5 + sed -i '' 's/SWIFT_VERSION = 4.0;/SWIFT_VERSION = 5.0;/g' DVR.xcodeproj/project.pbxproj + # Share the DVR-iOS scheme so Carthage can find it + xcodebuild -project DVR.xcodeproj -scheme DVR-iOS -sdk iphonesimulator -destination 'platform=iOS Simulator,name=iPhone 15' + - name: Install dep via Carthage run: | carthage bootstrap --platform iOS --cache-builds From 342bb9b050e7554bcc702e2d8a88d4093c831130 Mon Sep 17 00:00:00 2001 From: reeshika-h Date: Fri, 29 Aug 2025 16:32:46 +0530 Subject: [PATCH 2/2] Refactor CI workflow for iOS: update Ruby setup, patch DVR for Swift 5, and improve xcodebuild command --- .github/workflows/ci.yml | 42 +++++++++++++++++++--------------------- 1 file changed, 20 insertions(+), 22 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 384bd83..fe6d294 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -57,30 +57,26 @@ jobs: steps: - name: Checkout repository uses: actions/checkout@v3 - + - name: Configure Git credentials run: | git config --global url."https://x-access-token:${{ secrets.PKG_TOKEN }}@github.com/".insteadOf "https://github.com/" - - - name: Set up Ruby (for installing Bundler and Fastlane) + + - name: Set up Ruby uses: ruby/setup-ruby@v1 with: ruby-version: '3.0' - - name: Patch DVR project for Xcode + - name: Patch DVR (Swift 5) run: | mkdir -p Carthage/Checkouts git clone https://github.com/contentstack/contentstack-swift-dvr.git Carthage/Checkouts/contentstack-swift-dvr cd Carthage/Checkouts/contentstack-swift-dvr - # Force Swift 5 sed -i '' 's/SWIFT_VERSION = 4.0;/SWIFT_VERSION = 5.0;/g' DVR.xcodeproj/project.pbxproj - # Share the DVR-iOS scheme so Carthage can find it - xcodebuild -project DVR.xcodeproj -scheme DVR-iOS -sdk iphonesimulator -destination 'platform=iOS Simulator,name=iPhone 15' - name: Install dep via Carthage - run: | - carthage bootstrap --platform iOS --cache-builds - + run: carthage bootstrap --platform iOS --cache-builds + - name: Install dependencies via Swift Package Manager run: swift package resolve @@ -88,20 +84,22 @@ jobs: uses: maxim-lobanov/setup-xcode@v1 with: xcode-version: latest + - name: Create config file run: | echo '{ - "api_key": "${{ secrets.api_key }}", - "delivery_token": "${{ secrets.delivery_token }}", - "environment": "${{ secrets.environment }}" - }' > Tests/config.json - + "api_key": "${{ secrets.api_key }}", + "delivery_token": "${{ secrets.delivery_token }}", + "environment": "${{ secrets.environment }}" + }' > Tests/config.json + - name: Build and run tests run: | - xcodebuild test \ - -workspace ContentstackSwift.xcworkspace \ - -scheme "ContentstackSwift iOS Tests" \ - -destination 'platform=iOS Simulator,name=iPhone 15,OS=17.5' \ - -sdk iphonesimulator \ - ONLY_ACTIVE_ARCH=NO \ - CODE_SIGNING_ALLOWED=NO + xcodebuild test \ + -workspace ContentstackSwift.xcworkspace \ + -scheme "ContentstackSwift iOS Tests" \ + -destination 'platform=iOS Simulator,name=iPhone 14,OS=17.4' \ + -sdk iphonesimulator \ + ONLY_ACTIVE_ARCH=NO \ + CODE_SIGNING_ALLOWED=NO +