Unverified Commit aa7e9e47 authored by Frank Lee's avatar Frank Lee Committed by GitHub
Browse files

[workflow] fixed the test coverage report (#2614)

* [workflow] fixed the test coverage report

* polish code
parent b3973b99
...@@ -46,14 +46,17 @@ jobs: ...@@ -46,14 +46,17 @@ jobs:
run: | run: |
covNum=$(cat cov_number) covNum=$(cat cov_number)
title="The code coverage for the changed files is ${covNum}%." title="The code coverage for the changed files is ${covNum}%."
(echo $title; cat coverage.txt) > coverage_tmp.txt touch coverage_report.txt
mv coverage_tmp.txt coverage.txt echo $title >> coverage_report.txt
sed -i '2 i <details>' coverage.txt echo " " >> coverage_report.txt
sed -i '3 i <summary>Click me to view the complete report</summary>' coverage.txt echo "<details>" >> coverage_report.txt
sed -i '4 i \n' coverage.txt echo "<summary>Click me to view the complete report</summary>" >> coverage_report.txt
sed -i '5 i \`\`\`text' coverage.txt echo " " >> coverage_report.txt
echo "\`\`\`" >> coverage.txt echo "\`\`\`" >> coverage_report.txt
echo "</details>" >> coverage.txt cat coverage.txt >> coverage_report.txt
echo "\`\`\`" >> coverage_report.txt
echo "</details>" >> coverage_report.txt
mv coverage_report.txt coverage.txt
- name: 'Comment on PR' - name: 'Comment on PR'
if: steps.unzip.outputs.hasReport == 'true' if: steps.unzip.outputs.hasReport == 'true'
......
avai=true
for i in $(seq 0 7);
do
gpu_used=$(nvidia-smi -i $i --query-gpu=memory.used --format=csv,noheader,nounits)
[ "$gpu_used" -le "10000" ] && avai=false
done
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment