mirror of
https://github.com/spring-projects/spring-petclinic.git
synced 2025-07-21 15:25:49 +00:00
Update sonarcloud.yml
trying w/ sonarcloud maven example
This commit is contained in:
parent
037c37f82d
commit
a9fece6bab
1 changed files with 17 additions and 22 deletions
39
.github/workflows/sonarcloud.yml
vendored
39
.github/workflows/sonarcloud.yml
vendored
|
@ -50,27 +50,22 @@ jobs:
|
||||||
with:
|
with:
|
||||||
java-version: '17'
|
java-version: '17'
|
||||||
distribution: 'adopt'
|
distribution: 'adopt'
|
||||||
|
|
||||||
- name: Analyze with SonarCloud
|
|
||||||
|
|
||||||
# You can pin the exact commit or the version.
|
#https://github.com/SonarSource/sonarcloud-github-action-samples/blob/maven/.github/workflows/build-workflow.yml
|
||||||
# uses: SonarSource/sonarcloud-github-action@de2e56b42aa84d0b1c5b622644ac17e505c9a049
|
- name: Cache Maven packages
|
||||||
uses: SonarSource/sonarcloud-github-action@de2e56b42aa84d0b1c5b622644ac17e505c9a049
|
uses: actions/cache@v1
|
||||||
env:
|
|
||||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # Needed to get PR information
|
|
||||||
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} # Generate a token on Sonarcloud.io, add it to the secrets of this repo with the name SONAR_TOKEN (Settings > Secrets > Actions > add new repository secret)
|
|
||||||
with:
|
with:
|
||||||
# Additional arguments for the sonarcloud scanner
|
path: ~/.m2
|
||||||
args:
|
key: ${{ runner.os }}-m2-${{ hashFiles('**/pom.xml') }}
|
||||||
# Unique keys of your project and organization. You can find them in SonarCloud > Information (bottom-left menu)
|
restore-keys: ${{ runner.os }}-m2
|
||||||
# mandatory
|
- name: Cache SonarCloud packages
|
||||||
-Dsonar.projectKey=darefjev44_spring-petclinic
|
uses: actions/cache@v1
|
||||||
-Dsonar.organization=darefjev-mtu
|
with:
|
||||||
# Comma-separated paths to directories containing main source files.
|
path: ~/.sonar/cache
|
||||||
#-Dsonar.sources= # optional, default is project base directory
|
key: ${{ runner.os }}-sonar
|
||||||
# When you need the analysis to take place in a directory other than the one from which it was launched
|
restore-keys: ${{ runner.os }}-sonar
|
||||||
#-Dsonar.projectBaseDir= # optional, default is .
|
- name: Build and analyze
|
||||||
# Comma-separated paths to directories containing test source files.
|
run: mvn -B verify org.sonarsource.scanner.maven:sonar-maven-plugin:sonar -Pcoverage
|
||||||
#-Dsonar.tests= # optional. For more info about Code Coverage, please refer to https://docs.sonarcloud.io/enriching/test-coverage/overview/
|
env:
|
||||||
# Adds more detail to both client and server-side analysis logs, activating DEBUG mode for the scanner, and adding client-side environment variables and system properties to the server-side log of analysis report processing.
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||||
#-Dsonar.verbose= # optional, default is false
|
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
|
||||||
|
|
Loading…
Reference in a new issue