mirror of
https://github.com/apache/cloudstack.git
synced 2025-10-26 08:42:29 +01:00
.github: add support for PR decoration
Signed-off-by: Rohit Yadav <rohit.yadav@shapeblue.com>
This commit is contained in:
parent
1967b64b2b
commit
17afe0510e
21
.github/workflows/coverage-check.yml
vendored
21
.github/workflows/coverage-check.yml
vendored
@ -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<<EOF" >> $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
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user