Skip to content

Commit 02ac1d3

Browse files
author
Mihkel Kivisild
committed
Sonarcloud GitHub action for PHP library
WE2-897 Signed-off-by: Mihkel Kivisild <mihkel.kivisild@cgi.com>
1 parent 373afaf commit 02ac1d3

File tree

2 files changed

+5
-19
lines changed

2 files changed

+5
-19
lines changed

.github/workflows/sonarcloud-analysis.yml

Lines changed: 2 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -35,25 +35,8 @@ jobs:
3535
- name: Install dependencies
3636
run: composer install --prefer-dist --no-progress
3737

38-
- name: Install SonarScanner
39-
run: |
40-
wget https://binaries.sonarsource.com/Distribution/sonar-scanner-cli/4.8.0.2856/sonar-scanner-cli-4.8.0.2856-linux.zip
41-
unzip sonar-scanner-cli-4.8.0.2856-linux.zip
42-
sudo mv sonar-scanner-4.8.0.2856-linux /opt/sonar-scanner
43-
echo "/opt/sonar-scanner/bin" >> $GITHUB_PATH
44-
45-
- name: Verify SonarScanner Installation
46-
run: sonar-scanner --version
47-
4838
- name: Run SonarCloud Scan
39+
uses: sonarsource/sonarqube-scan-action@v3.1.0
4940
env:
50-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
5141
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
52-
run: |
53-
sonar-scanner \
54-
-Dsonar.projectKey="web-eid_web-eid-authtoken-validation-php" \
55-
-Dsonar.token=${{secrets.SONAR_TOKEN}} \
56-
-Dsonar.organization="web-eid" \
57-
-Dsonar.host.url="https://sonarcloud.io" \
58-
-Dsonar.php.tests.reportPath=tests/report.xml \
59-
-Dsonar.php.coverage.reportPaths=coverage/clover.xml
42+
SONAR_HOST_URL: https://sonarcloud.io

sonar-project.properties

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
sonar.projectKey=web-eid_web-eid-authtoken-validation-php
2+
sonar.sources=src/
3+
sonar.tests=tests/

0 commit comments

Comments
 (0)