File tree Expand file tree Collapse file tree 3 files changed +35
-29
lines changed Expand file tree Collapse file tree 3 files changed +35
-29
lines changed Original file line number Diff line number Diff line change @@ -40,12 +40,21 @@ jobs:
40
40
key : ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
41
41
restore-keys : |
42
42
${{ runner.os }}-maven-
43
+ - name : Cache SonarCloud packages
44
+ uses : actions/cache@v2.1.2
45
+ if : matrix.java_version == '11'
46
+ with :
47
+ path : ~/.sonar/cache
48
+ key : ${{ runner.os }}-sonar
49
+ restore-keys : ${{ runner.os }}-sonar
43
50
- name : Run tests
44
51
run : ./mvnw -V -B -ntp -ff verify jacoco:report
45
52
- name : Static Analysis (Sonar)
46
- # Sonar will require at least Java 11 soon.
47
53
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
49
58
- name : Release Snapshot
50
59
if : matrix.java_version == '11'
51
60
run : ./mvnw -V -B -ntp -ff deploy
Original file line number Diff line number Diff line change 32
32
key : ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
33
33
restore-keys : |
34
34
${{ runner.os }}-maven-
35
+ - name : Cache SonarCloud packages
36
+ uses : actions/cache@v2.1.2
37
+ if : matrix.java_version == '11'
38
+ with :
39
+ path : ~/.sonar/cache
40
+ key : ${{ runner.os }}-sonar
41
+ restore-keys : ${{ runner.os }}-sonar
35
42
- name : Run tests
36
43
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 69
69
<project .build.sourceEncoding>UTF-8</project .build.sourceEncoding>
70
70
<project .reporting.outputEncoding>UTF-8</project .reporting.outputEncoding>
71
71
<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
+
72
78
<swagger-parser .version>2.0.22</swagger-parser .version>
73
79
<slf4j .version>1.7.30</slf4j .version>
74
80
</properties >
311
317
<artifactId >jacoco-maven-plugin</artifactId >
312
318
<version >0.8.6</version >
313
319
</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 >
314
325
</plugins >
315
326
</pluginManagement >
316
327
<plugins >
362
373
<goal >prepare-agent</goal >
363
374
</goals >
364
375
</execution >
365
- <execution >
366
- <id >jacoco-site</id >
367
- <phase >test</phase >
368
- <goals >
369
- <goal >report</goal >
370
- </goals >
371
- </execution >
372
376
<execution >
373
377
<id >default-check</id >
374
378
<goals >
375
379
<goal >check</goal >
376
380
</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
381
</execution >
392
382
</executions >
393
- <configuration >
394
- <excludes >
395
- <!-- Example: -->
396
- <!-- <exclude>**/gradle-wrapper.jar</exclude> -->
397
- </excludes >
398
- </configuration >
399
383
</plugin >
400
384
</plugins >
401
385
</build >
You can’t perform that action at this time.
0 commit comments