File tree Expand file tree Collapse file tree 3 files changed +35
-35
lines changed
Expand file tree Collapse file tree 3 files changed +35
-35
lines changed Original file line number Diff line number Diff line change @@ -40,12 +40,21 @@ jobs:
4040 key : ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
4141 restore-keys : |
4242 ${{ runner.os }}-maven-
43+ - name : Cache SonarCloud packages
44+ 45+ if : matrix.java_version == '11'
46+ with :
47+ path : ~/.sonar/cache
48+ key : ${{ runner.os }}-sonar
49+ restore-keys : ${{ runner.os }}-sonar
4350 - name : Run tests
4451 run : ./mvnw -V -B -ntp -ff verify jacoco:report
4552 - name : Static Analysis (Sonar)
46- # Sonar will require at least Java 11 soon.
4753 if : matrix.java_version == '11'
48- run : ./mvnw -B -ntp -ff jacoco:report-aggregate org.sonarsource.scanner.maven:sonar-maven-plugin:sonar -Dsonar.projectKey=OpenAPITools_openapi-diff -Dsonar.organization=openapitools -Dsonar.host.url=https://sonarcloud.io -Dsonar.branch.name=${GITHUB_REF##*/}
54+ env :
55+ GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
56+ SONAR_TOKEN : ${{ secrets.SONAR_TOKEN }}
57+ run : ./mvnw -B -ntp -ff org.sonarsource.scanner.maven:sonar-maven-plugin:sonar
4958 - name : Release Snapshot
5059 if : matrix.java_version == '11'
5160 run : ./mvnw -V -B -ntp -ff deploy
Original file line number Diff line number Diff line change 3232 key : ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
3333 restore-keys : |
3434 ${{ runner.os }}-maven-
35+ - name : Cache SonarCloud packages
36+ 37+ if : matrix.java_version == '11'
38+ with :
39+ path : ~/.sonar/cache
40+ key : ${{ runner.os }}-sonar
41+ restore-keys : ${{ runner.os }}-sonar
3542 - name : Run tests
3643 run : ./mvnw -V -B -ntp -ff verify
44+ - name : Static Analysis (Sonar)
45+ if : matrix.java_version == '11'
46+ env :
47+ GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
48+ SONAR_TOKEN : ${{ secrets.SONAR_TOKEN }}
49+ run : ./mvnw -B -ntp -ff org.sonarsource.scanner.maven:sonar-maven-plugin:sonar
Original file line number Diff line number Diff line change 6969 <project .build.sourceEncoding>UTF-8</project .build.sourceEncoding>
7070 <project .reporting.outputEncoding>UTF-8</project .reporting.outputEncoding>
7171 <project .scm.id>github</project .scm.id>
72+
73+ <sonar .organization>openapitools</sonar .organization>
74+ <sonar .projectKey>OpenAPITools_openapi-diff</sonar .projectKey>
75+ <sonar .host.url>https://sonarcloud.io</sonar .host.url>
76+ <sonar .moduleKey>${project.artifactId} </sonar .moduleKey>
77+
7278 <swagger-parser .version>2.0.22</swagger-parser .version>
7379 <slf4j .version>1.7.30</slf4j .version>
7480 </properties >
311317 <artifactId >jacoco-maven-plugin</artifactId >
312318 <version >0.8.6</version >
313319 </plugin >
320+ <plugin >
321+ <groupId >org.sonarsource.scanner.maven</groupId >
322+ <artifactId >sonar-maven-plugin</artifactId >
323+ <version >3.7.0.1746</version >
324+ </plugin >
314325 </plugins >
315326 </pluginManagement >
316327 <plugins >
362373 <goal >prepare-agent</goal >
363374 </goals >
364375 </execution >
365- <execution >
366- <id >jacoco-site</id >
367- <phase >test</phase >
368- <goals >
369- <goal >report</goal >
370- </goals >
371- </execution >
372- <execution >
373- <id >default-check</id >
374- <goals >
375- <goal >check</goal >
376- </goals >
377- <configuration >
378- <rules >
379- <rule >
380- <element >PACKAGE</element >
381- <limits >
382- <limit >
383- <counter >LINE</counter >
384- <value >COVEREDRATIO</value >
385- <minimum >0</minimum >
386- </limit >
387- </limits >
388- </rule >
389- </rules >
390- </configuration >
391- </execution >
392376 </executions >
393- <configuration >
394- <excludes >
395- <!-- Example: -->
396- <!-- <exclude>**/gradle-wrapper.jar</exclude> -->
397- </excludes >
398- </configuration >
399377 </plugin >
400378 </plugins >
401379 </build >
You can’t perform that action at this time.
0 commit comments