Add sonar cloud check (#269)

* Update sonar.yaml

Fix scan only kafka-ui-react-app

* Update pom.xml

Add sonar cloud properties

* Update sonar.yaml

Change scan sonar cloud by maven

* include sonar scan to backend build job

* remove projectname from pom.xml
This commit is contained in:
Dmitriy Kharlamov 2021-03-17 15:50:25 +03:00 committed by GitHub
parent cfd10643e5
commit 7a8417e0d1
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 13 additions and 22 deletions

View file

@ -23,5 +23,14 @@ jobs:
uses: actions/setup-java@v1
with:
java-version: 1.13
- name: Build with Maven
run: mvn clean package -Pprod
- name: Cache SonarCloud packages
uses: actions/cache@v1
with:
path: ~/.sonar/cache
key: ${{ runner.os }}-sonar
restore-keys: ${{ runner.os }}-sonar
- name: Build and analyze
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # Needed to get PR information, if any
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
run: mvn -B verify org.sonarsource.scanner.maven:sonar-maven-plugin:sonar

View file

@ -1,20 +0,0 @@
name: Build
on:
push:
branches:
- master
pull_request:
types: [opened, synchronize, reopened]
jobs:
sonarcloud:
name: SonarCloud
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0 # Shallow clones should be disabled for a better relevancy of analysis
- name: SonarCloud Scan
uses: SonarSource/sonarcloud-github-action@master
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # Needed to get PR information, if any
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}

View file

@ -40,6 +40,8 @@
<assertj.version>3.19.0</assertj.version>
<frontend-generated-sources-directory>..//kafka-ui-react-app/src/generated-sources</frontend-generated-sources-directory>
<sonar.organization>provectus</sonar.organization>
<sonar.host.url>https://sonarcloud.io</sonar.host.url>
</properties>
<repositories>