-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[AAE-28943] Add sonar scanner action
- Loading branch information
Showing
3 changed files
with
16 additions
and
77 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,58 +1,16 @@ | ||
name: 'Process Coverage Report' | ||
description: 'Process the generated coverage for further reporting, uses JaCoCo-report plugin' | ||
name: 'Sonar Scanner' | ||
description: 'Run Sonar Scanner to load JaCoCo report on SonarCloud' | ||
inputs: | ||
sonar_token: | ||
description: 'SonarCloud token to upload the coverage report' | ||
description: 'SonarCloud token' | ||
required: true | ||
paths: | ||
description: 'Comma separated paths of the generated JaCoCo xml files (supports wildcard glob pattern)' | ||
aggregate-report-path: | ||
description: 'Path of the aggregated JaCoCo report' | ||
required: true | ||
token: | ||
description: 'Github personal token to add commits to Pull Request' | ||
project_key: | ||
description: 'SonarCloud project key' | ||
required: true | ||
min-coverage-overall: | ||
description: 'The minimum code coverage that is required to pass for overall project' | ||
required: false | ||
default: '80' | ||
min-coverage-changed-files: | ||
description: 'The minimum code coverage that is required to pass for changed files' | ||
required: false | ||
default: '80' | ||
title: | ||
description: 'Optional title for the Pull Request comment' | ||
required: false | ||
update-comment: | ||
description: 'Update the coverage report comment instead of creating new ones. Requires title to works properly.' | ||
required: false | ||
default: 'false' | ||
skip-if-no-changes: | ||
description: "Comment won't be added if there is no coverage information present for the files changed" | ||
required: false | ||
default: 'false' | ||
pass-emoji: | ||
description: 'Github emoji to use for pass status shown when coverage greater than min coverage (should be a Github supported emoji)' | ||
required: false | ||
default: ':green_apple:' | ||
fail-emoji: | ||
description: 'Github emoji to use for fail status shown when coverage lesser than min coverage (should be a Github supported emoji)' | ||
required: false | ||
default: ':x:' | ||
continue-on-error: | ||
description: 'When there is an error do not fail the action, but log a warning' | ||
required: false | ||
default: 'true' | ||
debug-mode: | ||
description: 'Run the action in debug mode and get debug logs printed in console' | ||
required: false | ||
default: 'false' | ||
|
||
outputs: | ||
coverage-overall: | ||
description: 'The overall coverage of the project' | ||
value: ${{ steps.jacoco-aggregate.outputs.coverage-overall }} | ||
coverage-changed-files: | ||
description: 'The total coverage of all changed files' | ||
value: ${{ steps.jacoco-aggregate.outputs.coverage-changed-files }} | ||
|
||
runs: | ||
using: composite | ||
|
@@ -62,28 +20,4 @@ runs: | |
SONAR_TOKEN: ${{ inputs.sonar_token }} | ||
shell: bash | ||
run: | | ||
mvn sonar:sonar -Dsonar.host.url=https://sonarcloud.io -Dsonar.organization=alfresco -Dsonar.projectKey=Alfresco_hxp-studio-services -Dsonar.coverage.jacoco.xmlReportPaths=${{ inputs.paths }} | ||
# - name: SonarCloud Scan | ||
# uses: sonarsource/[email protected] | ||
# env: | ||
# SONAR_TOKEN: ${{ inputs.sonar_token }} | ||
# with: | ||
# args: > | ||
# -Dsonar.coverage.jacoco.xmlReportPaths=${{ inputs.paths }} | ||
# - uses: madrapps/jacoco-report@7c362aca34caf958e7b1c03464bd8781db9f8da7 # v1.7.1 | ||
# id: jacoco-aggregate | ||
# with: | ||
# paths: ${{ inputs.paths }} | ||
# token: ${{ inputs.token }} | ||
# min-coverage-overall: ${{ inputs.min-coverage-overall }} | ||
# min-coverage-changed-files: ${{ inputs.min-coverage-changed-files }} | ||
# title: ${{ inputs.title }} | ||
# update-comment: ${{ inputs.update-comment }} | ||
# skip-if-no-changes: ${{ inputs.skip-if-no-changes }} | ||
# pass-emoji: ${{ inputs.pass-emoji }} | ||
# fail-emoji: ${{ inputs.fail-emoji }} | ||
# continue-on-error: ${{ inputs.continue-on-error }} | ||
# debug-mode: ${{ inputs.debug-mode }} | ||
# coverage-overall: ${{ inputs.coverage-overall }} | ||
# coverage-changed-files: ${{ inputs.coverage-changed-files }} | ||
mvn sonar:sonar -Dsonar.host.url=https://sonarcloud.io -Dsonar.organization=alfresco -Dsonar.projectKey=${{ inputs.project_key}} -Dsonar.coverage.jacoco.xmlReportPaths=${{ inputs.aggregate-report-path }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters