From 17afe0510e43cc4b78c1e868dda7a5dc1c7abfb0 Mon Sep 17 00:00:00 2001 From: Rohit Yadav Date: Wed, 4 May 2022 01:02:38 +0530 Subject: [PATCH] .github: add support for PR decoration Signed-off-by: Rohit Yadav --- .github/workflows/coverage-check.yml | 21 +-------------------- 1 file changed, 1 insertion(+), 20 deletions(-) diff --git a/.github/workflows/coverage-check.yml b/.github/workflows/coverage-check.yml index b72709eebca..0a51702f11f 100644 --- a/.github/workflows/coverage-check.yml +++ b/.github/workflows/coverage-check.yml @@ -91,23 +91,4 @@ jobs: run: | git clone https://github.com/shapeblue/cloudstack-nonoss.git nonoss cd nonoss && bash -x install-non-oss.sh && cd .. - mvn -P quality -Dsimulator -Dnoredist clean install org.sonarsource.scanner.maven:sonar-maven-plugin:sonar -Dsonar.projectKey=apache_cloudstack - - echo "COVERAGE<> $GITHUB_ENV - for file in ${{ steps.java-changes.outputs.all_changed_files }}; do - name=$(basename $file | sed 's/.java//g') - coverage=$(grep ,$name, client/target/site/jacoco-aggregate/jacoco.csv | cut -f3-9 -d"," | sed 's/,/|/g') - echo $coverage - if [[ ! -z "${coverage// }" ]]; then - echo "|$coverage|" >> $GITHUB_ENV - fi - done - echo "EOF" >> $GITHUB_ENV - - - name: Comment PR Coverage Report - uses: peter-evans/create-or-update-comment@c9fcb64660bc90ec1cc535646af190c992007c32 - if: steps.java-changes.outputs.any_changed == 'true' - with: - token: ${{ secrets.ACS_ROBOT_TOKEN }} - issue-number: ${{ github.event.pull_request.number }} - body: "## PR Analysis\nhttps://sonarcloud.io/summary/new_code?id=apachecloudstack&pullRequest=${{ github.event.pull_request.number }}\n## PR Coverage Report\n|**CLASS**|**INSTRUCTION MISSED**|**INSTRUCTION COVERED**|**BRANCH MISSED**|**BRANCH COVERED**|**LINE MISSED**|**LINE COVERED**|\n|-----|-----|-----|-----|-----|-----|-----|\n${{ env.COVERAGE }}" + mvn -P quality -Dsimulator -Dnoredist clean install org.sonarsource.scanner.maven:sonar-maven-plugin:sonar -Dsonar.projectKey=apache_cloudstack -Dsonar.pullrequest.key=$PR_ID -Dsonar.pullrequest.branch=${{ github.event.pull_request.head.ref }} -Dsonar.pullrequest.github.repository=apache/cloudstack -Dsonar.pullrequest.provider=GitHub -Dsonar.pullrequest.github.summary_comment=true