Skip to content

Commit

Permalink
AAE-28943 Create sonar scan action (#840)
Browse files Browse the repository at this point in the history
Co-authored-by: Paweł Maciusiak <[email protected]>
  • Loading branch information
mavotto and pmacius authored Dec 20, 2024
1 parent 7a39cf2 commit c5d38b0
Show file tree
Hide file tree
Showing 4 changed files with 56 additions and 1 deletion.
31 changes: 31 additions & 0 deletions .github/actions/sonar-scanner/action.yml
Original file line number Diff line number Diff line change
@@ -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 }}
8 changes: 8 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
16 changes: 16 additions & 0 deletions docs/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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).
Expand Down
2 changes: 1 addition & 1 deletion version.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
v8.6.3
v8.7.0

0 comments on commit c5d38b0

Please sign in to comment.