Skip to content

Commit c488565

Browse files
mavottopmaciusgionn
authored
AAE-28943 Include sonar scanner in build action (#861)
Co-authored-by: Paweł Maciusiak <158472457+pmacius@users.noreply.github.com> Co-authored-by: Giovanni Toraldo <71768+gionn@users.noreply.github.com>
1 parent e9fbe00 commit c488565

File tree

2 files changed

+25
-2
lines changed

2 files changed

+25
-2
lines changed

.github/actions/maven-build-and-tag/action.yml

Lines changed: 24 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,23 @@ inputs:
8686
description: The label name for skipping tests
8787
required: false
8888
default: 'skip-tests'
89+
sonar-token:
90+
description: 'SonarCloud token'
91+
required: false
92+
aggregate-report-path:
93+
description: 'Path of the aggregated JaCoCo report'
94+
required: false
95+
project-key:
96+
description: 'SonarCloud project key'
97+
required: false
98+
sonar-host-url:
99+
description: 'SonarCloud host url'
100+
required: false
101+
default: 'https://sonarcloud.io'
102+
sonar-organization:
103+
description: 'SonarCloud organization'
104+
required: false
105+
default: 'alfresco'
89106

90107
outputs:
91108
version:
@@ -240,13 +257,19 @@ runs:
240257
echo "testcontainers.reuse.enable=true" > ~/.testcontainers.properties
241258
echo "TESTCONTAINERS_RYUK_DISABLED=true" >> $GITHUB_ENV
242259
260+
- name: Set SONAR_SCANNER_OPTS
261+
if: inputs.sonar-token != ''
262+
shell: bash
263+
run: echo "SONAR_SCANNER_OPTS=sonar:sonar -Dsonar.host.url=${{ inputs.sonar-host-url }} -Dsonar.organization=${{ inputs.sonar-organization }} -Dsonar.projectKey=${{ inputs.project-key }} -Dsonar.coverage.jacoco.xmlReportPaths=${{ inputs.aggregate-report-path }}" >> $GITHUB_ENV
264+
243265
- name: Build and Test with Maven (and maybe Deploy)
244266
shell: bash
245-
run: mvn ${{ steps.define_maven_command.outputs.command }} ${{ env.MAVEN_CLI_OPTS}} ${{ inputs.extra-maven-opts }}
267+
run: mvn ${{ steps.define_maven_command.outputs.command }} ${{ env.MAVEN_CLI_OPTS }} ${{ inputs.extra-maven-opts }} ${{ env.SONAR_SCANNER_OPTS }}
246268
env:
247269
MAVEN_CLI_OPTS: ${{ steps.compute-maven-options.outputs.result }} -Dlogging.root.level=off -Dspring.main.banner-mode=off -Ddocker.skip -Dmaven.build.cache.enabled=${{ env.MAVEN_BUILD_CACHE_ENABLED }}
248270
MAVEN_USERNAME: ${{ inputs.maven-username }}
249271
MAVEN_PASSWORD: ${{ inputs.maven-password }}
272+
SONAR_TOKEN: ${{ inputs.sonar-token }}
250273

251274
- name: Remove running docker containers
252275
if: inputs.reuse-testcontainers == 'true'

version.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
v8.8.1
1+
v8.9.0

0 commit comments

Comments
 (0)