Skip to content

Commit 342bb9b

Browse files
committed
Refactor CI workflow for iOS: update Ruby setup, patch DVR for Swift 5, and improve xcodebuild command
1 parent 3b23731 commit 342bb9b

1 file changed

Lines changed: 20 additions & 22 deletions

File tree

.github/workflows/ci.yml

Lines changed: 20 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -57,51 +57,49 @@ jobs:
5757
steps:
5858
- name: Checkout repository
5959
uses: actions/checkout@v3
60-
60+
6161
- name: Configure Git credentials
6262
run: |
6363
git config --global url."https://x-access-token:${{ secrets.PKG_TOKEN }}@github.com/".insteadOf "https://github.com/"
64-
65-
- name: Set up Ruby (for installing Bundler and Fastlane)
64+
65+
- name: Set up Ruby
6666
uses: ruby/setup-ruby@v1
6767
with:
6868
ruby-version: '3.0'
6969

70-
- name: Patch DVR project for Xcode
70+
- name: Patch DVR (Swift 5)
7171
run: |
7272
mkdir -p Carthage/Checkouts
7373
git clone https://github.com/contentstack/contentstack-swift-dvr.git Carthage/Checkouts/contentstack-swift-dvr
7474
cd Carthage/Checkouts/contentstack-swift-dvr
75-
# Force Swift 5
7675
sed -i '' 's/SWIFT_VERSION = 4.0;/SWIFT_VERSION = 5.0;/g' DVR.xcodeproj/project.pbxproj
77-
# Share the DVR-iOS scheme so Carthage can find it
78-
xcodebuild -project DVR.xcodeproj -scheme DVR-iOS -sdk iphonesimulator -destination 'platform=iOS Simulator,name=iPhone 15'
7976
8077
- name: Install dep via Carthage
81-
run: |
82-
carthage bootstrap --platform iOS --cache-builds
83-
78+
run: carthage bootstrap --platform iOS --cache-builds
79+
8480
- name: Install dependencies via Swift Package Manager
8581
run: swift package resolve
8682

8783
- name: Set up Xcode
8884
uses: maxim-lobanov/setup-xcode@v1
8985
with:
9086
xcode-version: latest
87+
9188
- name: Create config file
9289
run: |
9390
echo '{
94-
"api_key": "${{ secrets.api_key }}",
95-
"delivery_token": "${{ secrets.delivery_token }}",
96-
"environment": "${{ secrets.environment }}"
97-
}' > Tests/config.json
98-
91+
"api_key": "${{ secrets.api_key }}",
92+
"delivery_token": "${{ secrets.delivery_token }}",
93+
"environment": "${{ secrets.environment }}"
94+
}' > Tests/config.json
95+
9996
- name: Build and run tests
10097
run: |
101-
xcodebuild test \
102-
-workspace ContentstackSwift.xcworkspace \
103-
-scheme "ContentstackSwift iOS Tests" \
104-
-destination 'platform=iOS Simulator,name=iPhone 15,OS=17.5' \
105-
-sdk iphonesimulator \
106-
ONLY_ACTIVE_ARCH=NO \
107-
CODE_SIGNING_ALLOWED=NO
98+
xcodebuild test \
99+
-workspace ContentstackSwift.xcworkspace \
100+
-scheme "ContentstackSwift iOS Tests" \
101+
-destination 'platform=iOS Simulator,name=iPhone 14,OS=17.4' \
102+
-sdk iphonesimulator \
103+
ONLY_ACTIVE_ARCH=NO \
104+
CODE_SIGNING_ALLOWED=NO
105+

0 commit comments

Comments
 (0)