Skip to content

Commit

Permalink
Merge pull request #54 from contentstack/staging
Browse files Browse the repository at this point in the history
DX | 27-01-2025 | Release
  • Loading branch information
cs-raj authored Feb 4, 2025
2 parents b807cae + a1c7823 commit ceb6446
Show file tree
Hide file tree
Showing 24 changed files with 365 additions and 213 deletions.
138 changes: 76 additions & 62 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,75 +10,89 @@ jobs:
macOS:
name: Test macOS
runs-on: macos-latest
env:
DEVELOPER_DIR: /Applications/Xcode_14.2.app/Contents/Developer
steps:
- uses: actions/checkout@v1
- 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)
uses: ruby/setup-ruby@v1
with:
ruby-version: '3.0'

- name: Install dep via Carthage
run: |
carthage bootstrap --platform macOS --use-xcframeworks --cache-builds
- name: Install dependencies via Swift Package Manager
run: swift package resolve

- name: Set up Xcode
uses: maxim-lobanov/setup-xcode@v1
with:
path: Carthage
key: ${{ runner.os }}-carthage-${{ hashFiles('**/Cartfile.resolved') }}
restore-keys: |
${{ runner.os }}-carthage-
- name: Dependencies
run: carthage bootstrap --no-use-binaries --platform macOS
- name: Dependency libxml2
run: brew install libxml2 && brew link --force libxml2
- name: macOS
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
xcode-version: '15.4.0'

- name: Create config file
run: |
echo '{
"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 Contentstack.xcworkspace \
-scheme "Contentstack macOS Tests" \
-destination 'platform=macOS,arch=arm64' \
ONLY_ACTIVE_ARCH=NO \
CODE_SIGNING_ALLOWED=NO
iOS:
name: Test iOS
runs-on: macos-latest
env:
DEVELOPER_DIR: /Applications/Xcode_14.2.app/Contents/Developer
strategy:
matrix:
destination: ["OS=16.2,name=iPhone 14 Pro"]
steps:
- uses: actions/checkout@v1
- 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)
uses: ruby/setup-ruby@v1
with:
path: Carthage
key: ${{ runner.os }}-carthage-${{ hashFiles('**/Cartfile.resolved') }}
restore-keys: |
${{ runner.os }}-carthage-
- name: Dependencies
run: carthage bootstrap --no-use-binaries --platform iOS --use-xcframeworks
- name: iOS - ${{ matrix.destination }}
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
ruby-version: '3.0'

- name: Install dep via Carthage
run: |
carthage bootstrap --platform iOS --use-xcframeworks --cache-builds
- name: Install dependencies via Swift Package Manager
run: swift package resolve

tvOS:
name: Test tvOS
runs-on: macos-latest
env:
DEVELOPER_DIR: /Applications/Xcode_14.2.app/Contents/Developer
strategy:
matrix:
destination: ["OS=16.1,name=Apple TV 4K (2nd generation)"]
steps:
- uses: actions/checkout@v1
- name: Set up Xcode
uses: maxim-lobanov/setup-xcode@v1
with:
path: Carthage
key: ${{ runner.os }}-carthage-${{ hashFiles('**/Cartfile.resolved') }}
restore-keys: |
${{ runner.os }}-carthage-
- name: Dependencies
run: carthage bootstrap --no-use-binaries --platform tvOS --use-xcframeworks
- name: tvOS - ${{ matrix.destination }}
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
xcode-version: '15.4.0'

- name: Create config file
run: |
echo '{
"api_key": "${{ secrets.api_key }}",
"delivery_token": "${{ secrets.delivery_token }}",
"environment": "${{ secrets.environment }}"
}' > Tests/config.json
watchOS:
name: Test watchOS
runs-on: macos-latest
env:
DEVELOPER_DIR: /Applications/Xcode_14.2.app/Contents/Developer
strategy:
matrix:
destination: ["OS=9.1,name=Apple Watch Series 6 (44mm)"]
steps:
- uses: actions/checkout@v1
with:
path: Carthage
key: ${{ runner.os }}-carthage-${{ hashFiles('**/Cartfile.resolved') }}
restore-keys: |
${{ runner.os }}-carthage-
- name: watchOS - ${{ matrix.destination }}
run: set -o pipefail && env NSUnbufferedIO=YES xcodebuild -workspace "Contentstack.xcworkspace" -scheme "Contentstack watchOS" -destination "${{ matrix.destination }}" build | xcpretty
- name: Build and run tests
run: |
xcodebuild test \
-workspace Contentstack.xcworkspace \
-scheme "Contentstack iOS Tests" \
-destination 'platform=iOS Simulator,name=iPhone 15,OS=17.2' \
-sdk iphonesimulator \
ONLY_ACTIVE_ARCH=NO \
CODE_SIGNING_ALLOWED=NO
11 changes: 10 additions & 1 deletion .github/workflows/sca-scan.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,16 @@ jobs:
steps:
- uses: actions/checkout@master
- uses: snyk/actions/setup@master
- name: Configure Git credentials
run: |
git config --global url."https://x-access-token:${{ secrets.PKG_TOKEN }}@github.com/".insteadOf "https://github.com/"
- name: Resolve Swift package dependencies
run: swift package resolve
- name: Run Snyk to check for vulnerabilities
run: snyk test --all-projects --fail-on=all
env:
SNYK_TOKEN: ${{ secrets.SNYK_TOKEN }}
SNYK_TOKEN: ${{ secrets.SNYK_TOKEN }}
- name: Cleanup credentials
if: always()
run: rm -f ~/.gitconfig
4 changes: 2 additions & 2 deletions Cartfile
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
github "AliSoftware/OHHTTPStubs" "8.0.0"
github "venmo/DVR" "v2.0.1"
github "contentstack/contentstack-swift-dvr" "master"
github "contentstack/contentstack-utils-swift"
4 changes: 2 additions & 2 deletions Cartfile.resolved
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
github "AliSoftware/OHHTTPStubs" "8.0.0"
github "venmo/DVR" "v2.0.1"
github "contentstack/contentstack-swift-dvr" "c8040a2451e4bc2c312347531cac6c73f23ce50c"
github "contentstack/contentstack-utils-swift" "v1.3.4"
Loading

0 comments on commit ceb6446

Please sign in to comment.