Skip to content

Commit

Permalink
Add sonarcloud scanning to poipath
Browse files Browse the repository at this point in the history
  • Loading branch information
AntonOellerer committed Oct 15, 2021
1 parent e712382 commit 7279fdf
Show file tree
Hide file tree
Showing 2 changed files with 43 additions and 1 deletion.
30 changes: 29 additions & 1 deletion .github/workflows/check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -80,4 +80,32 @@ jobs:
if: always()
with:
name: test-results
path: build/reports/tests/test
path: build/reports/tests/test
sonarcloud:
name: sonarcloud
runs-on: ubuntu-20.04
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
steps:
- name: Checkout
uses: actions/checkout@v2
with:
fetch-depth: 0 # Shallow clones should be disabled for a better relevancy of analysis
- name: Setup Java
uses: actions/setup-java@v2.3.1
with:
java-version: 17
distribution: 'zulu'
- name: Cache SonarCloud packages
uses: actions/cache@v1
with:
path: ~/.sonar/cache
key: ${{ runner.os }}-sonar
restore-keys: ${{ runner.os }}-sonar
- name: Run sonarqube check
uses: gradle/gradle-build-action@v2
with:
arguments: build sonarqube --info
env:
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # Needed to get PR information, if any
14 changes: 14 additions & 0 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ plugins {
id 'maven-publish'
id "org.owasp.dependencycheck" version "6.4.1.1"
id 'checkstyle'
id "org.sonarqube" version "3.3"
}

group = 'com.docutools'
Expand Down Expand Up @@ -80,3 +81,16 @@ tasks.withType(Checkstyle) {
html.destination rootProject.file("build/reports/checkstyle.html")
}
}

sonarqube {
properties {
property "sonar.projectKey", "poipath"
property "sonar.organization", "docu-tools"
property "sonar.host.url", "https://sonarcloud.io"
property "sonar.sourceEncoding", "UTF-8"
property "sonar.verbose", "true"
property "sonar.sources", "src/main/java/"
property "sonar.language", "java"
property "sonar.java.binaries", "."
}
}

0 comments on commit 7279fdf

Please sign in to comment.