File tree Expand file tree Collapse file tree 3 files changed +34
-31
lines changed Expand file tree Collapse file tree 3 files changed +34
-31
lines changed Original file line number Diff line number Diff line change 6060 -Dmaven.wagon.http.retryHandler.count=3
6161 -Dmaven.wagon.httpconnectionManager.ttlSeconds=25
6262
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/*
7163
7264 - name : Validate PR
7365 id : validate_pr
8476 JAVA_HOME : /usr/lib/jvm/java-11-openjdk-amd64
8577 run : >-
8678 mvn org.sonarsource.scanner.maven:sonar-maven-plugin:sonar -fae -T 2 -B -V
87- -Dmaven.repo.local=$HOME/.m2/repository11
8879 -DcloudBuild
8980 -Pcoverage
9081 -Dmaven.wagon.http.retryHandler.count=3
9384 -Dsonar.pullrequest.branch=${{ steps.validate_pr.outputs.pr-branch }}
9485 -Dsonar.pullrequest.base=${{ steps.validate_pr.outputs.pr-base }}
9586 -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 4343 restore-keys : |
4444 ${{ runner.os }}-maven-${{ github.workflow }}
4545
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+
4653 - 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 }}
4880
4981 - name : Archive build artifacts
5082 uses : actions/upload-artifact@v3
Original file line number Diff line number Diff line change 6565 <jacoco .version>0.8.8</jacoco .version>
6666
6767 <sonar .organization>data-integrations</sonar .organization>
68- <sonar .projectKey>data-integrations_ ${project.artifactId} </sonar .projectKey>
68+ <sonar .projectKey>${sonar.organization} _ ${project.artifactId} </sonar .projectKey>
6969 <sonar .host.url>https://sonarcloud.io</sonar .host.url>
7070 <sonar .coverage.jacoco.xmlReportPaths>
7171 ${maven.multiModuleProjectDirectory} /delta-coverage/target/site/jacoco-aggregate/jacoco.xml
You can’t perform that action at this time.
0 commit comments