File tree 3 files changed +34
-31
lines changed
3 files changed +34
-31
lines changed Original file line number Diff line number Diff line change 60
60
-Dmaven.wagon.http.retryHandler.count=3
61
61
-Dmaven.wagon.httpconnectionManager.ttlSeconds=25
62
62
63
- - name : Archive build artifacts
64
- uses : actions/upload-artifact@v3
65
- if : always()
66
- with :
67
- name : Build debug files
68
- path : |
69
- **/target/rat.txt
70
- **/target/surefire-reports/*
71
63
72
64
- name : Validate PR
73
65
id : validate_pr
84
76
JAVA_HOME : /usr/lib/jvm/java-11-openjdk-amd64
85
77
run : >-
86
78
mvn org.sonarsource.scanner.maven:sonar-maven-plugin:sonar -fae -T 2 -B -V
87
- -Dmaven.repo.local=$HOME/.m2/repository11
88
79
-DcloudBuild
89
80
-Pcoverage
90
81
-Dmaven.wagon.http.retryHandler.count=3
93
84
-Dsonar.pullrequest.branch=${{ steps.validate_pr.outputs.pr-branch }}
94
85
-Dsonar.pullrequest.base=${{ steps.validate_pr.outputs.pr-base }}
95
86
-Dsonar.branch.name=${{ github.event.workflow_run.head_branch }}
96
-
97
- - name : Archive build artifacts
98
- uses : actions/upload-artifact@v3
99
- if : always()
100
- with :
101
- name : Build debug files
102
- path : |
103
- **/target/rat.txt
104
- **/target/surefire-reports/*
105
-
106
- - name : Surefire Report
107
- # Pinned 3.5.2 version
108
- uses : mikepenz/action-junit-report@16a9560bd02f11e7e3bf6b3e2ef6bba6c9d07c32
109
- if : always()
110
- with :
111
- report_paths : ' **/target/surefire-reports/TEST-*.xml'
112
- github_token : ${{ secrets.GITHUB_TOKEN }}
113
- detailed_summary : true
114
- commit : ${{ github.event.workflow_run.head_sha }}
115
- check_name : Sonar Build Test Report
Original file line number Diff line number Diff line change 43
43
restore-keys : |
44
44
${{ runner.os }}-maven-${{ github.workflow }}
45
45
46
+ - name : Cache SonarCloud packages
47
+ uses : actions/cache@v3
48
+ with :
49
+ path : ~/.sonar/cache
50
+ key : ${{ runner.os }}-sonar
51
+ restore-keys : ${{ runner.os }}-sonar
52
+
46
53
- name : Build with Maven
47
- run : mvn clean compile test -fae -T 2 -B -V -DcloudBuild -Dmaven.wagon.http.retryHandler.count=3 -Dmaven.wagon.httpconnectionManager.ttlSeconds=25
54
+ run : mvn clean verify -fae -T 2 -B -V -DcloudBuild -Dmaven.wagon.http.retryHandler.count=3 -Dmaven.wagon
55
+ .httpconnectionManager.ttlSeconds=25
56
+
57
+ - name : Validate PR
58
+ id : validate_pr
59
+ # For whatever reason we get PR 69 for develop branch with both head and base as develop.
60
+ if : ${{ github.event.workflow_run.pull_requests[0].head.ref != github.event.workflow_run.pull_requests[0].base.ref }}
61
+ run : |
62
+ echo ":set-output pr-key=${{ github.event.workflow_run.pull_requests[0].number }}"
63
+ echo ":set-output pr-branch=${{ github.event.workflow_run.pull_requests[0].head.ref }}"
64
+ echo ":set-output pr-base=${{ github.event.workflow_run.pull_requests[0].base.ref }}"
65
+
66
+ - name : Sonar report
67
+ env :
68
+ SONAR_TOKEN : ${{ secrets.SONAR_TOKEN }}
69
+ JAVA_HOME : /usr/lib/jvm/java-11-openjdk-amd64
70
+ run : >-
71
+ mvn org.sonarsource.scanner.maven:sonar-maven-plugin:sonar -fae -T 2 -B -V
72
+ -DcloudBuild
73
+ -Pcoverage
74
+ -Dmaven.wagon.http.retryHandler.count=3
75
+ -Dmaven.wagon.httpconnectionManager.ttlSeconds=25
76
+ -Dsonar.pullrequest.key=${{ steps.validate_pr.outputs.pr-key }}
77
+ -Dsonar.pullrequest.branch=${{ steps.validate_pr.outputs.pr-branch }}
78
+ -Dsonar.pullrequest.base=${{ steps.validate_pr.outputs.pr-base }}
79
+ -Dsonar.branch.name=${{ github.event.workflow_run.head_branch }}
48
80
49
81
- name : Archive build artifacts
50
82
uses : actions/upload-artifact@v3
Original file line number Diff line number Diff line change 65
65
<jacoco .version>0.8.8</jacoco .version>
66
66
67
67
<sonar .organization>data-integrations</sonar .organization>
68
- <sonar .projectKey>data-integrations_ ${project.artifactId} </sonar .projectKey>
68
+ <sonar .projectKey>${sonar.organization} _ ${project.artifactId} </sonar .projectKey>
69
69
<sonar .host.url>https://sonarcloud.io</sonar .host.url>
70
70
<sonar .coverage.jacoco.xmlReportPaths>
71
71
${maven.multiModuleProjectDirectory} /delta-coverage/target/site/jacoco-aggregate/jacoco.xml
You can’t perform that action at this time.
0 commit comments