Skip to content

Commit 4590616

Browse files
authored
Merge pull request #54 from contentstack/staging
DX | 27-01-2025 | Release
2 parents b807cae + cfb31f9 commit 4590616

24 files changed

+365
-213
lines changed

.github/workflows/ci.yml

Lines changed: 76 additions & 62 deletions
Original file line numberDiff line numberDiff line change
@@ -10,75 +10,89 @@ jobs:
1010
macOS:
1111
name: Test macOS
1212
runs-on: macos-latest
13-
env:
14-
DEVELOPER_DIR: /Applications/Xcode_14.2.app/Contents/Developer
1513
steps:
16-
- uses: actions/checkout@v1
14+
- name: Checkout repository
15+
uses: actions/checkout@v3
16+
17+
- name: Configure Git credentials
18+
run: |
19+
git config --global url."https://x-access-token:${{ secrets.PKG_TOKEN }}@github.com/".insteadOf "https://github.com/"
20+
21+
- name: Set up Ruby (for installing Bundler and Fastlane)
22+
uses: ruby/setup-ruby@v1
23+
with:
24+
ruby-version: '3.0'
25+
26+
- name: Install dep via Carthage
27+
run: |
28+
carthage bootstrap --platform macOS --use-xcframeworks --cache-builds
29+
30+
- name: Install dependencies via Swift Package Manager
31+
run: swift package resolve
32+
33+
- name: Set up Xcode
34+
uses: maxim-lobanov/setup-xcode@v1
1735
with:
18-
path: Carthage
19-
key: ${{ runner.os }}-carthage-${{ hashFiles('**/Cartfile.resolved') }}
20-
restore-keys: |
21-
${{ runner.os }}-carthage-
22-
- name: Dependencies
23-
run: carthage bootstrap --no-use-binaries --platform macOS
24-
- name: Dependency libxml2
25-
run: brew install libxml2 && brew link --force libxml2
26-
- name: macOS
27-
run: set -o pipefail && env NSUnbufferedIO=YES xcodebuild -workspace "Contentstack.xcworkspace" -scheme "Contentstack macOS" SWIFT_ACTIVE_COMPILATION_CONDITIONS="NO_FATAL_TEST" -destination "platform=macOS" test | xcpretty
36+
xcode-version: '15.4.0'
37+
38+
- name: Create config file
39+
run: |
40+
echo '{
41+
"api_key": "${{ secrets.api_key }}",
42+
"delivery_token": "${{ secrets.delivery_token }}",
43+
"environment": "${{ secrets.environment }}"
44+
}' > Tests/config.json
45+
46+
- name: Build and run tests
47+
run: |
48+
xcodebuild test \
49+
-workspace Contentstack.xcworkspace \
50+
-scheme "Contentstack macOS Tests" \
51+
-destination 'platform=macOS,arch=arm64' \
52+
ONLY_ACTIVE_ARCH=NO \
53+
CODE_SIGNING_ALLOWED=NO
2854
iOS:
2955
name: Test iOS
3056
runs-on: macos-latest
31-
env:
32-
DEVELOPER_DIR: /Applications/Xcode_14.2.app/Contents/Developer
33-
strategy:
34-
matrix:
35-
destination: ["OS=16.2,name=iPhone 14 Pro"]
3657
steps:
37-
- uses: actions/checkout@v1
58+
- name: Checkout repository
59+
uses: actions/checkout@v3
60+
61+
- name: Configure Git credentials
62+
run: |
63+
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)
66+
uses: ruby/setup-ruby@v1
3867
with:
39-
path: Carthage
40-
key: ${{ runner.os }}-carthage-${{ hashFiles('**/Cartfile.resolved') }}
41-
restore-keys: |
42-
${{ runner.os }}-carthage-
43-
- name: Dependencies
44-
run: carthage bootstrap --no-use-binaries --platform iOS --use-xcframeworks
45-
- name: iOS - ${{ matrix.destination }}
46-
run: set -o pipefail && env NSUnbufferedIO=YES xcodebuild -workspace "Contentstack.xcworkspace" -scheme "Contentstack iOS" SWIFT_ACTIVE_COMPILATION_CONDITIONS="NO_FATAL_TEST" -destination "${{ matrix.destination }}" test | xcpretty
68+
ruby-version: '3.0'
69+
70+
- name: Install dep via Carthage
71+
run: |
72+
carthage bootstrap --platform iOS --use-xcframeworks --cache-builds
73+
74+
- name: Install dependencies via Swift Package Manager
75+
run: swift package resolve
4776

48-
tvOS:
49-
name: Test tvOS
50-
runs-on: macos-latest
51-
env:
52-
DEVELOPER_DIR: /Applications/Xcode_14.2.app/Contents/Developer
53-
strategy:
54-
matrix:
55-
destination: ["OS=16.1,name=Apple TV 4K (2nd generation)"]
56-
steps:
57-
- uses: actions/checkout@v1
77+
- name: Set up Xcode
78+
uses: maxim-lobanov/setup-xcode@v1
5879
with:
59-
path: Carthage
60-
key: ${{ runner.os }}-carthage-${{ hashFiles('**/Cartfile.resolved') }}
61-
restore-keys: |
62-
${{ runner.os }}-carthage-
63-
- name: Dependencies
64-
run: carthage bootstrap --no-use-binaries --platform tvOS --use-xcframeworks
65-
- name: tvOS - ${{ matrix.destination }}
66-
run: set -o pipefail && env NSUnbufferedIO=YES xcodebuild -workspace "Contentstack.xcworkspace" -scheme "Contentstack tvOS" SWIFT_ACTIVE_COMPILATION_CONDITIONS="NO_FATAL_TEST" -destination "${{ matrix.destination }}" test | xcpretty
80+
xcode-version: '15.4.0'
81+
82+
- name: Create config file
83+
run: |
84+
echo '{
85+
"api_key": "${{ secrets.api_key }}",
86+
"delivery_token": "${{ secrets.delivery_token }}",
87+
"environment": "${{ secrets.environment }}"
88+
}' > Tests/config.json
6789
68-
watchOS:
69-
name: Test watchOS
70-
runs-on: macos-latest
71-
env:
72-
DEVELOPER_DIR: /Applications/Xcode_14.2.app/Contents/Developer
73-
strategy:
74-
matrix:
75-
destination: ["OS=9.1,name=Apple Watch Series 6 (44mm)"]
76-
steps:
77-
- uses: actions/checkout@v1
78-
with:
79-
path: Carthage
80-
key: ${{ runner.os }}-carthage-${{ hashFiles('**/Cartfile.resolved') }}
81-
restore-keys: |
82-
${{ runner.os }}-carthage-
83-
- name: watchOS - ${{ matrix.destination }}
84-
run: set -o pipefail && env NSUnbufferedIO=YES xcodebuild -workspace "Contentstack.xcworkspace" -scheme "Contentstack watchOS" -destination "${{ matrix.destination }}" build | xcpretty
90+
- name: Build and run tests
91+
run: |
92+
xcodebuild test \
93+
-workspace Contentstack.xcworkspace \
94+
-scheme "Contentstack iOS Tests" \
95+
-destination 'platform=iOS Simulator,name=iPhone 15,OS=17.2' \
96+
-sdk iphonesimulator \
97+
ONLY_ACTIVE_ARCH=NO \
98+
CODE_SIGNING_ALLOWED=NO

.github/workflows/sca-scan.yml

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,16 @@ jobs:
88
steps:
99
- uses: actions/checkout@master
1010
- uses: snyk/actions/setup@master
11+
- name: Configure Git credentials
12+
run: |
13+
git config --global url."https://x-access-token:${{ secrets.PKG_TOKEN }}@github.com/".insteadOf "https://github.com/"
14+
15+
- name: Resolve Swift package dependencies
16+
run: swift package resolve
1117
- name: Run Snyk to check for vulnerabilities
1218
run: snyk test --all-projects --fail-on=all
1319
env:
14-
SNYK_TOKEN: ${{ secrets.SNYK_TOKEN }}
20+
SNYK_TOKEN: ${{ secrets.SNYK_TOKEN }}
21+
- name: Cleanup credentials
22+
if: always()
23+
run: rm -f ~/.gitconfig

Cartfile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
github "AliSoftware/OHHTTPStubs" "8.0.0"
2-
github "venmo/DVR" "v2.0.1"
1+
github "contentstack/contentstack-swift-dvr" "master"
2+
github "contentstack/contentstack-utils-swift"

Cartfile.resolved

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
github "AliSoftware/OHHTTPStubs" "8.0.0"
2-
github "venmo/DVR" "v2.0.1"
1+
github "contentstack/contentstack-swift-dvr" "c8040a2451e4bc2c312347531cac6c73f23ce50c"
2+
github "contentstack/contentstack-utils-swift" "v1.3.4"

0 commit comments

Comments
 (0)