Skip to content

Commit

Permalink
Add SonarCloud integration to GitHub Actions (#156)
Browse files Browse the repository at this point in the history
The GitHub Actions pipeline now includes a step to perform a SonarCloud
scan. The new "SonarCloud Scan" step will utilize the SonarSource
sonarcloud-github-action, and takes advantage of GITHUB and SONAR tokens
stored as secrets. Additionally, a new 'sonar-project.properties' file
has been added, configuring the project for SonarCloud analysis.
  • Loading branch information
SmetDenis committed Apr 10, 2024
1 parent b1b91c4 commit 161b603
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 0 deletions.
6 changes: 6 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,12 @@ jobs:
COVERALLS_REPO_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: make report-coveralls --no-print-directory || true

- name: SonarCloud Scan
uses: SonarSource/sonarcloud-github-action@master
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}

- name: Upload Artifacts
uses: actions/upload-artifact@v4
continue-on-error: true
Expand Down
8 changes: 8 additions & 0 deletions sonar-project.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
sonar.projectKey=JBZoo_Csv-Blueprint
sonar.organization=jbzoo
sonar.projectName=CSV Blueprint

sonar.sources=src
sonar.tests=tests

sonar.php.coverage.reportPaths=build/coverage_xml/main.xml

0 comments on commit 161b603

Please sign in to comment.