Skip to content

Commit

Permalink
Add to test
Browse files Browse the repository at this point in the history
  • Loading branch information
gabrielnedersantos committed Dec 18, 2024
1 parent 7636316 commit a160767
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 29 deletions.
41 changes: 19 additions & 22 deletions .github/workflows/check_sonar_tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,11 @@ jobs:
- name: Install CocoaPods
run: |
gem install cocoapods
pod install --project-directory=Example
pod install --project-directory=Example
- name: Generate sonar-project.properties
run: |
echo "sonar.login=${{ env.SONAR_TOKEN_SECRET }}" >> ./sonar-project.properties
- name: Install dependencies
run: |
Expand All @@ -46,10 +50,20 @@ jobs:
# Install Lizard
brew install lizard
- name: Devices list
- name: Install SonarQube Scanner
run: |
xcrun simctl list devices
SONAR_SCANNER_VERSION=5.0.1.3006
SONAR_SCANNER_DIR=/opt/sonar-scanner
curl -o sonar-scanner-cli.zip -L "https://binaries.sonarsource.com/Distribution/sonar-scanner-cli/sonar-scanner-cli-${SONAR_SCANNER_VERSION}-linux.zip"
sudo apt-get install -y unzip
unzip sonar-scanner-cli.zip
sudo mv sonar-scanner-${SONAR_SCANNER_VERSION}-linux ${SONAR_SCANNER_DIR}
echo "${SONAR_SCANNER_DIR}/bin" >> $GITHUB_PATH
echo "SonarScanner installed successfully!"
- name: Run Sonar-Swift Script
run: |
Expand All @@ -62,21 +76,4 @@ jobs:
echo "Coverage report generated successfully: sonar-reports/generic-coverage.xml"
else
echo "Coverage report not found!" && exit 1
fi
- name: Run SonarQube Analysis
run: |
sonar-scanner -X \
-Dsonar.host.url=${SONAR_HOST_URL} \
-Dsonar.login=${SONAR_TOKEN} \
-Dsonar.projectKey=${SONAR_PROJECT_KEY} \
-Dsonar.projectName=${SONAR_PROJECT_NAME} \
-Dsonar.pullrequest.base="${{ github.base_ref }}" \
-Dsonar.pullrequest.branch="${{ github.head_ref }}" \
-Dsonar.pullrequest.key="${{ github.event.pull_request.number }}" \
-Dsonar.scm.revision="${{ github.event.pull_request.head.sha }}" \
-Dsonar.coverageReportPaths=sonar-reports/generic-coverage.xml \
-Dsonar.scm.disabled=true \
-Dsonar.language=swift \
-Dsonar.sources="." \
-Dsonar.verbose=true
fi
11 changes: 4 additions & 7 deletions sonar-project.properties
Original file line number Diff line number Diff line change
Expand Up @@ -17,15 +17,12 @@
#

# Sonar Server details
sonar.host.url=http://localhost:9000
sonar.login=admin
sonar.password=Sonarqube$24
# sonar.token=sqp_8cba87ecfe9b5459a833660cabcdc5e8a138deb8
sonar.host.url=https://sonarqube.trustly.one
sonar.login=${SONAR_TOKEN_SECRET}

# Project Details
sonar.projectKey=org.cocoapods.TrustlySDK-Example
sonar.projectName=TrustlySDKIOS
sonar.projectDescription=This is the Sonar demo application for the code quality check
sonar.projectKey=trustly-ios
sonar.projectName=trustly-ios

# Comment if you have a project with mixed ObjC / Swift
sonar.language=swift
Expand Down

0 comments on commit a160767

Please sign in to comment.