Skip to content

Commit

Permalink
Adding pointers to PR
Browse files Browse the repository at this point in the history
  • Loading branch information
nagarev committed Nov 10, 2024
1 parent 98efb00 commit 0cca8c0
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 5 deletions.
20 changes: 15 additions & 5 deletions .github/workflows/build_and_test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -101,14 +101,24 @@ jobs:
- name: Run SonarQube analysis
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 }}
run: |
./gradlew -Dorg.gradle.jvmargs=-Xmx5g sonar --no-daemon -x build -x test \
-Dsonar.branch.name="$GH_REF" \
-Dsonar.junit.reportPaths=rskj-core/build/test-results/ \
-Dsonar.coverage.jacoco.xmlReportPaths=rskj-core/build/reports/jacoco/test/jacocoTestReport.xml \
-Dsonar.token="$SONAR_TOKEN"
if [ "$GH_EVENT" = "pull_request" ]; then # If this is a PR, then add pointers to it
./gradlew -Dorg.gradle.jvmargs=-Xmx5g sonar --no-daemon -x build -x test \
-Dsonar.pullrequest.base="$GH_PR_BASE_REF" \
-Dsonar.pullrequest.branch="$GH_PR_HEAD_REF" \
-Dsonar.pullrequest.key="$GH_PR_NUMBER" \
-Dsonar.token="$SONAR_TOKEN"
else
./gradlew -Dorg.gradle.jvmargs=-Xmx5g sonar --no-daemon -x build -x test \
-Dsonar.branch.name="$GH_REF" \
-Dsonar.token="$SONAR_TOKEN"
fi
mining-tests:
needs: build
Expand Down
2 changes: 2 additions & 0 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ sonar {
property "sonar.projectKey", "rskj"
property "sonar.organization", "rsksmart"
property "sonar.host.url", "https://sonarcloud.io"
property "sonar.junit.reportPaths", "rskj-core/build/test-results/"
property "sonar.coverage.jacoco.xmlReportPaths", "rskj-core/build/reports/jacoco/test/jacocoTestReport.xml"
}
}

Expand Down

0 comments on commit 0cca8c0

Please sign in to comment.