Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MOB-838 Updating Primary build for Code Coverage #98

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,6 @@ jobs:
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
- name: SonarCloud Scan
uses: SonarSource/sonarcloud-github-action@master
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
Expand Down
14 changes: 13 additions & 1 deletion .github/workflows/primary.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,10 +30,22 @@ jobs:
uses: maxim-lobanov/setup-xcode@v1
with:
xcode-version: latest-stable

- name: Setup environment
run: |
bundle install

- name: Build
run: swift build -v
- name: Run tests
run: swift test -v
run: |
swift test --enable-code-coverage -v
xcrun llvm-cov show -instr-profile=.build/debug/codecov/default.profdata .build/debug/PaystackSDKPackageTests.xctest/Contents/MacOS/PaystackSDKPackageTests > coverage.report
brew install sonar-scanner
bundle exec fastlane sonar_scan
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}

PodLinting:
runs-on: macos-12
Expand Down
6 changes: 6 additions & 0 deletions Gemfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
source "https://rubygems.org"

gem "fastlane"

plugins_path = File.join(File.dirname(__FILE__), 'fastlane', 'Pluginfile')
eval_gemfile(plugins_path) if File.exist?(plugins_path)
34 changes: 34 additions & 0 deletions fastlane/Fastfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
# This file contains the fastlane.tools configuration
# You can find the documentation at https://docs.fastlane.tools
#
# For a list of all available actions, check out
#
# https://docs.fastlane.tools/actions
#
# For a list of all available plugins, check out
#
# https://docs.fastlane.tools/plugins/available-plugins
#

# Uncomment the line if you want fastlane to automatically update itself
# update_fastlane

default_platform(:ios)

platform :ios do

desc "Run Sonar Scan"
lane :sonar_scan do

sonar(
project_key: "PaystackHQ_paystack-sdk-ios",
project_version: "1.0",
project_name: "paystack-sdk-ios",
sources_path: File.expand_path("../Sources/"),
sonar_organization: "paystackhq",
sonar_login: ENV["SONAR_TOKEN"],
sonar_url: "https://sonarcloud.io"
)
end

end
2 changes: 1 addition & 1 deletion sonar-project.properties
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
sonar.projectKey=PaystackHQ_paystack-sdk-ios
sonar.organization=paystackhq
sonar.javascript.lcov.reportPaths=./lcov.info
sonar.swift.coverage.reportPaths=coverage.report