Skip to content

Commit

Permalink
MOB-936 Update Continuous and deployment Workflow
Browse files Browse the repository at this point in the history
	- Updated workflow for main branch to run with Xcodebuild instead of swift build
	- Changed the deployment of Cocoapods from MacOS to Linux and installing cocoapods on Linux machine
  • Loading branch information
Peter-John-paystack committed May 27, 2024
1 parent d75f205 commit 4e30d12
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 6 deletions.
20 changes: 14 additions & 6 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,20 @@ jobs:

steps:
- uses: actions/checkout@v4
- name: Build
run: swift build -v
- name: Run tests
- name: Select Xcode Version
uses: maxim-lobanov/setup-xcode@v1
with:
xcode-version: '15.3.0'

- name: Setup environment
run: |
bundle install
- name: Build and Run tests
run: |
swift test --enable-code-coverage -v
xcrun llvm-cov export -format="lcov" .build/debug/PaystackSDKPackageTests.xctest/Contents/MacOS/PaystackSDKPackageTests -instr-profile .build/debug/codecov/default.profdata > info.lcov
xcodebuild clean build test -scheme PaystackSDK-Package -sdk iphonesimulator17.4 -destination "OS=17.4,name=iPhone 15 Pro" -enableCodeCoverage YES CODE_SIGNING_REQUIRED=NO
brew install sonar-scanner
bundle exec fastlane sonar_scan
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
Expand All @@ -35,7 +43,7 @@ jobs:
- name: setup-cocoapods
uses: maxim-lobanov/setup-cocoapods@v1
with:
version: 1.14.2
version: 1.15.2

- name: Run pod lint for Paystack Core
run: pod lib lint PaystackCore.podspec --allow-warnings
Expand Down
12 changes: 12 additions & 0 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,20 @@ jobs:
release_name: ${{ env.version }}
body: ${{ env.body }}

Publish Cocoapods:
runs-on: ubuntu-latest
needs: deploy
steps:
- name: Checkout
uses: actions/checkout@v4

- uses: ruby/setup-ruby@v1
with:
ruby-version: '3.2.2'

- name: Deploy to Cocoapods
run: |
gem install cocoapods
set -eo pipefail
pod trunk push PaystackCore.podspec --allow-warnings
pod trunk push PaystackUI.podspec --allow-warnings
Expand Down

0 comments on commit 4e30d12

Please sign in to comment.