Skip to content

Commit

Permalink
Add to test
Browse files Browse the repository at this point in the history
  • Loading branch information
gabrielnedersantos committed Nov 25, 2024
1 parent 84b24c6 commit 3c6ba24
Showing 1 changed file with 11 additions and 13 deletions.
24 changes: 11 additions & 13 deletions .github/workflows/sonar_analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,11 +28,6 @@ jobs:
run: |
sudo xcode-select --switch /Applications/Xcode.app/Contents/Developer
- name: Set up Ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: '3.2'

- name: Install CocoaPods
run: |
gem install cocoapods
Expand All @@ -41,21 +36,23 @@ jobs:
- name: Install xcpretty
run: gem install xcpretty

- name: Generate Compilation Database
run: |
xcodebuild clean build | xcpretty -r json-compilation-database -o compile_commands.json
env:
PATH: "${PATH}:$(gem environment gemdir)/bin"

- name: Run Tests
- name: Run Tests with Coverage
run: |
xcodebuild -workspace Example/TrustlySDK.xcworkspace \
-scheme TrustlySDK-Example \
-destination 'platform=iOS Simulator,name=iPhone 15,OS=17.4' \
test
test \
-enableCodeCoverage YES
- name: Generate LCOV Coverage Report
run: |
xcrun xccov view --report --json $(find . -name "*.xccovarchive") > coverage.json
npm install -g xccov-to-lcov
xccov-to-lcov -i coverage.json -o coverage.lcov
- name: Install Sonar Scanner
run: |
brew update
brew install sonar-scanner
- name: SonarQube Analysis
Expand All @@ -72,5 +69,6 @@ jobs:
-Dsonar.cfamily.compile-commands=compile_commands.json \
-Dsonar.sources="." \
-Dsonar.exclusions="**/Tests/**" \
-Dsonar.javascript.lcov.reportPaths=coverage.lcov \
-Dsonar.verbose=true \
-Dsonar.sourceEncoding=UTF-8

0 comments on commit 3c6ba24

Please sign in to comment.