1- name : SonarCloud scan for User Services
2- on :
3- workflow_call :
4- secrets :
5- SONAR_TOKEN :
6- required : true
7- jobs :
8- sonar-cloud-scan :
9- name : Build and analyze
10- runs-on : ubuntu-latest
11- steps :
12- - uses : actions/checkout@v3
13- with :
14- fetch-depth : 0 # Shallow clones should be disabled for a better relevancy of analysis
15- - name : Set up JDK 17
16- uses : actions/setup-java@v3
17- with :
18- java-version : 17
19- distribution : ' zulu' # Alternative distribution options are available.
20- - name : Cache SonarCloud packages
21- uses : actions/cache@v3
22- with :
23- path : ~/.sonar/cache
24- key : ${{ runner.os }}-sonar
25- restore-keys : ${{ runner.os }}-sonar
26- - name : Cache Maven packages
27- uses : actions/cache@v3
28- with :
29- path : ~/.m2
30- key : ${{ runner.os }}-m2-${{ hashFiles('**/pom.xml') }}
31- restore-keys : ${{ runner.os }}-m2
32- - name : Build and analyze
33- env :
34- SONAR_TOKEN : ${{ secrets.SONAR_TOKEN }}
35- run : mvn -B verify org.sonarsource.scanner.maven:sonar-maven-plugin:sonar -Dsonar.projectKey=DevOps-Video-Sharing_UserService
1+ # name: SonarCloud scan for User Services
2+ # on:
3+ # workflow_call:
4+ # secrets:
5+ # SONAR_TOKEN:
6+ # required: true
7+ # jobs:
8+ # sonar-cloud-scan:
9+ # name: Build and analyze
10+ # runs-on: ubuntu-latest
11+ # steps:
12+ # - uses: actions/checkout@v3
13+ # with:
14+ # fetch-depth: 0 # Shallow clones should be disabled for a better relevancy of analysis
15+ # - name: Set up JDK 17
16+ # uses: actions/setup-java@v3
17+ # with:
18+ # java-version: 17
19+ # distribution: 'zulu' # Alternative distribution options are available.
20+ # - name: Cache SonarCloud packages
21+ # uses: actions/cache@v3
22+ # with:
23+ # path: ~/.sonar/cache
24+ # key: ${{ runner.os }}-sonar
25+ # restore-keys: ${{ runner.os }}-sonar
26+ # - name: Cache Maven packages
27+ # uses: actions/cache@v3
28+ # with:
29+ # path: ~/.m2
30+ # key: ${{ runner.os }}-m2-${{ hashFiles('**/pom.xml') }}
31+ # restore-keys: ${{ runner.os }}-m2
32+ # - name: Build and analyze
33+ # env:
34+ # SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
35+ # run: mvn -B verify org.sonarsource.scanner.maven:sonar-maven-plugin:sonar -Dsonar.projectKey=DevOps-Video-Sharing_UserService
0 commit comments