Skip to content

Commit

Permalink
Add sonarcloud support
Browse files Browse the repository at this point in the history
  • Loading branch information
nagarev committed Oct 28, 2024
1 parent 31fdae2 commit 6cd5e18
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 0 deletions.
21 changes: 21 additions & 0 deletions .github/workflows/build_and_test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,27 @@ jobs:
path: |
rskj-core/build
sonarcloud:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
# Disabling shallow clone is recommended for improving relevancy of reporting
fetch-depth: 0
- name: SonarCloud Scan
uses: sonarsource/[email protected] # Ex: v3.1.0, See the latest version at https://github.com/marketplace/actions/sonarcloud-scan
env:
GH_EVENT: ${{ github.event_name }}
GH_PR_NUMBER: ${{ github.event.pull_request.number }}
GH_PR_BASE_REF: ${{ github.base_ref }}
GH_PR_HEAD_REF: ${{ github.head_ref }}
GH_REF: ${{ github.ref }}
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
with:
args: >
-Dsonar.branch.name="$GH_REF"
-Dsonar.verbose=true
smell-test:
needs: unit-tests-java17
runs-on: ubuntu-latest
Expand Down
9 changes: 9 additions & 0 deletions sonar-project.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
sonar.organization=rsksmart
sonar.projectKey=rskj
sonar.host.url=https://sonarcloud.io
sonar.junit.reportPaths=./rskj-core/build/test-results/
sonar.coverage.jacoco.xmlReportPaths=./rskj-core/build/reports/jacoco/test/jacocoTestReport.xml

# relative paths to source directories. More details and properties are described
# in https://sonarcloud.io/documentation/project-administration/narrowing-the-focus/
sonar.sources=./rskj-core

0 comments on commit 6cd5e18

Please sign in to comment.