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:
parent
cfd10643e5
commit
7a8417e0d1
3 changed files with 13 additions and 22 deletions
13
.github/workflows/backend.yml
vendored
13
.github/workflows/backend.yml
vendored
|
@ -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
|
20
.github/workflows/sonar.yaml
vendored
20
.github/workflows/sonar.yaml
vendored
|
@ -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 }}
|
2
pom.xml
2
pom.xml
|
@ -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>
|
||||
|
|
Loading…
Add table
Reference in a new issue