Skip to content

Commit 76cb05f

Browse files
committed
add sonarqube
1 parent 7f7c2af commit 76cb05f

2 files changed

Lines changed: 33 additions & 26 deletions

File tree

.github/workflows/ci.yml

Lines changed: 26 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -57,29 +57,29 @@ jobs:
5757
- name: Set VERSION env
5858
run: echo "VERSION=$(cat src/Version.php | grep 'const CURRENT' | cut -d "'" -f 2 | sed "s/'//g")" >> $GITHUB_ENV
5959

60-
# - name: SonarQube Scan (Push)
61-
# if: matrix.version == '8.2' && github.event_name == 'push'
62-
# uses: SonarSource/sonarcloud-github-action@v1.9
63-
# env:
64-
# SONAR_TOKEN: ${{ secrets.SONARQUBE_TOKEN }}
65-
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
66-
# with:
67-
# projectBaseDir: .
68-
# args: >
69-
# -Dsonar.host.url=${{ secrets.SONARQUBE_HOST }}
70-
# -Dsonar.projectVersion=${{ env.VERSION }}
71-
#
72-
# - name: SonarQube Scan (Pull Request)
73-
# if: matrix.version == '8.2' && github.event_name == 'pull_request'
74-
# uses: SonarSource/sonarcloud-github-action@v1.9
75-
# env:
76-
# SONAR_TOKEN: ${{ secrets.SONARQUBE_TOKEN }}
77-
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
78-
# with:
79-
# projectBaseDir: .
80-
# args: >
81-
# -Dsonar.host.url=${{ secrets.SONARQUBE_HOST }}
82-
# -Dsonar.projectVersion=${{ env.VERSION }}
83-
# -Dsonar.pullrequest.key=${{ github.event.pull_request.number }}
84-
# -Dsonar.pullrequest.branch=${{ github.event.pull_request.head.ref }}
85-
# -Dsonar.pullrequest.base=${{ github.event.pull_request.base.ref }}
60+
- name: SonarQube Scan (Push)
61+
if: matrix.version == '8.2' && github.event_name == 'push'
62+
uses: SonarSource/sonarcloud-github-action@v1.9
63+
env:
64+
SONAR_TOKEN: ${{ secrets.SONARQUBE_TOKEN }}
65+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
66+
with:
67+
projectBaseDir: .
68+
args: >
69+
-Dsonar.host.url=${{ secrets.SONARQUBE_HOST }}
70+
-Dsonar.projectVersion=${{ env.VERSION }}
71+
72+
- name: SonarQube Scan (Pull Request)
73+
if: matrix.version == '8.2' && github.event_name == 'pull_request'
74+
uses: SonarSource/sonarcloud-github-action@v1.9
75+
env:
76+
SONAR_TOKEN: ${{ secrets.SONARQUBE_TOKEN }}
77+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
78+
with:
79+
projectBaseDir: .
80+
args: >
81+
-Dsonar.host.url=${{ secrets.SONARQUBE_HOST }}
82+
-Dsonar.projectVersion=${{ env.VERSION }}
83+
-Dsonar.pullrequest.key=${{ github.event.pull_request.number }}
84+
-Dsonar.pullrequest.branch=${{ github.event.pull_request.head.ref }}
85+
-Dsonar.pullrequest.base=${{ github.event.pull_request.base.ref }}

sonar-project.properties

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
sonar.projectName=php-thin-client
2+
sonar.projectKey=splitsoftware_split-thin-sdk
3+
sonar.sources=src
4+
sonar.tests=tests
5+
sonar.php.coverage.reportPaths=coverage.xml
6+
sonar.links.ci=https://github.com/splitio/php-thin-client
7+
sonar.links.scm=https://github.com/splitio/php-thin-client/actions

0 commit comments

Comments
 (0)