Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

AAE-28943 Include sonar scanner in build action #861

Merged
25 changes: 24 additions & 1 deletion .github/actions/maven-build-and-tag/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,23 @@ inputs:
description: The label name for skipping tests
required: false
default: 'skip-tests'
sonar-token:
description: 'SonarCloud token'
required: false
aggregate-report-path:
description: 'Path of the aggregated JaCoCo report'
required: false
project-key:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

(detail) could have named this one sonar-project-key for consistency

description: 'SonarCloud project key'
required: false
sonar-host-url:
description: 'SonarCloud host url'
required: false
default: 'https://sonarcloud.io'
sonar-organization:
description: 'SonarCloud organization'
required: false
default: 'alfresco'

outputs:
version:
Expand Down Expand Up @@ -240,13 +257,19 @@ runs:
echo "testcontainers.reuse.enable=true" > ~/.testcontainers.properties
echo "TESTCONTAINERS_RYUK_DISABLED=true" >> $GITHUB_ENV

- name: Set SONAR_SCANNER_OPTS
if: ${{ inputs.sonar-token != '' && github.actor != 'dependabot[bot]' }}
mavotto marked this conversation as resolved.
Show resolved Hide resolved
shell: bash
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

- name: Build and Test with Maven (and maybe Deploy)
shell: bash
run: mvn ${{ steps.define_maven_command.outputs.command }} ${{ env.MAVEN_CLI_OPTS}} ${{ inputs.extra-maven-opts }}
run: mvn ${{ steps.define_maven_command.outputs.command }} ${{ env.MAVEN_CLI_OPTS}} ${{ inputs.extra-maven-opts }} ${{ env.SONAR_SCANNER_OPTS }}
mavotto marked this conversation as resolved.
Show resolved Hide resolved
env:
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 }}
MAVEN_USERNAME: ${{ inputs.maven-username }}
MAVEN_PASSWORD: ${{ inputs.maven-password }}
SONAR_TOKEN: ${{ inputs.sonar-token }}

- name: Remove running docker containers
if: inputs.reuse-testcontainers == 'true'
Expand Down
2 changes: 1 addition & 1 deletion version.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
v8.8.1
v8.9.0
Loading