diff --git a/.github/actions/sonar-scanner/action.yml b/.github/actions/sonar-scanner/action.yml new file mode 100644 index 000000000..db9715aac --- /dev/null +++ b/.github/actions/sonar-scanner/action.yml @@ -0,0 +1,31 @@ +name: 'Sonar Scanner' +description: 'Run Sonar Scanner to load JaCoCo report on SonarCloud' +inputs: + sonar-token: + description: 'SonarCloud token' + required: true + aggregate-report-path: + description: 'Path of the aggregated JaCoCo report' + required: true + project-key: + description: 'SonarCloud project key' + required: true + sonar-host-url: + description: 'SonarCloud host url' + required: false + default: 'https://sonarcloud.io' + sonar-organization: + description: 'SonarCloud organization' + required: false + default: 'alfresco' + + +runs: + using: composite + steps: + - name: Load JaCoCo report on SonarCloud + env: + SONAR_TOKEN: ${{ inputs.sonar-token }} + shell: bash + run: | + mvn 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 }} diff --git a/.github/dependabot.yml b/.github/dependabot.yml index 7c77b16f0..b9747dbf6 100644 --- a/.github/dependabot.yml +++ b/.github/dependabot.yml @@ -585,6 +585,14 @@ updates: catch-all: patterns: - "*" + - package-ecosystem: "github-actions" + directory: "/.github/actions/sonar-scanner" + schedule: + interval: "weekly" + groups: + catch-all: + patterns: + - "*" - package-ecosystem: "github-actions" directory: "/.github/actions/update-deployment-runtime-versions" schedule: diff --git a/docs/README.md b/docs/README.md index 652781ed6..a3f5db464 100644 --- a/docs/README.md +++ b/docs/README.md @@ -98,6 +98,7 @@ Here follows the list of GitHub Actions topics available in the current document - [setup-terraform-docs](#setup-terraform-docs) - [setup-updatebot](#setup-updatebot) - [slack-file-upload](#slack-file-upload) + - [sonar-scanner](#sonar-scanner) - [update-deployment-runtime-versions](#update-deployment-runtime-versions) - [update-pom-to-next-pre-release](#update-pom-to-next-pre-release) - [update-project-base-tag](#update-project-base-tag) @@ -1654,6 +1655,21 @@ Uploads a file to a Slack channel. file-title: 'file description' # optional ``` +### sonar-scanner + +Run Sonar Scanner to load JaCoCo report on SonarCloud. + +```yaml + - uses: Alfresco/alfresco-build-tools/.github/actions/sonar-scanner@ref + with: + sonar-token: ${{ secrets.SONAR_TOKEN }} + aggregate-report-path: ${{ github.workspace }}/coverage-folder/target/site/jacoco-aggregate/jacoco.xml + project-key: sonar-project-key + +``` + +sonar-host-url and sonar-organization are optional inputs. If not provided, the default values will be used. + ### update-deployment-runtime-versions For more information, see [update-deployment-runtime-versions](../.github/actions/update-deployment-runtime-versions/action.yml). diff --git a/version.txt b/version.txt index 9127c00fe..c78ac6140 100644 --- a/version.txt +++ b/version.txt @@ -1 +1 @@ -v8.6.3 +v8.7.0