From 4f402196d459055cc7ad30bca800b86fe4edc706 Mon Sep 17 00:00:00 2001 From: FrankLeeeee Date: Tue, 7 Feb 2023 11:40:35 +0800 Subject: [PATCH 1/2] [workflow] fixed the test coverage report --- .github/workflows/report_test_coverage.yml | 19 +++++++++++-------- .txt | 15 +++++++++++++++ test.sh | 6 ------ 3 files changed, 26 insertions(+), 14 deletions(-) create mode 100644 .txt delete mode 100644 test.sh diff --git a/.github/workflows/report_test_coverage.yml b/.github/workflows/report_test_coverage.yml index 0efb7d85782a..bbada74e6850 100644 --- a/.github/workflows/report_test_coverage.yml +++ b/.github/workflows/report_test_coverage.yml @@ -46,14 +46,17 @@ jobs: run: | covNum=$(cat cov_number) title="The code coverage for the changed files is ${covNum}%." - (echo $title; cat coverage.txt) > coverage_tmp.txt - mv coverage_tmp.txt coverage.txt - sed -i '2 i
' coverage.txt - sed -i '3 i Click me to view the complete report' coverage.txt - sed -i '4 i \n' coverage.txt - sed -i '5 i \`\`\`text' coverage.txt - echo "\`\`\`" >> coverage.txt - echo "
" >> coverage.txt + touch coverage_report.txt + echo $title >> coverage_report.txt + echo " " >> coverage_report.txt + echo "
" >> coverage_report.txt + echo "Click me to view the complete report" >> coverage_report.txt + echo " " >> coverage_report.txt + echo "\`\`\`" >> coverage_report.txt + cat coverage.txt >> coverage_report.txt + echo "\`\`\`" >> coverage_report.txt + echo "
" >> coverage_report.txt + mv coverage_report.txt coverage.txt - name: 'Comment on PR' if: steps.unzip.outputs.hasReport == 'true' diff --git a/.txt b/.txt new file mode 100644 index 000000000000..0afd0dae85ec --- /dev/null +++ b/.txt @@ -0,0 +1,15 @@ +The code coverage for the changed files is %. + +
+The code coverage for the changed files is %. + +
+The code coverage for the changed files is %. + +
+The code coverage for the changed files is 87%. + +
+The code coverage for the changed files is 87%. + +
diff --git a/test.sh b/test.sh deleted file mode 100644 index 8dcecc6ddc55..000000000000 --- a/test.sh +++ /dev/null @@ -1,6 +0,0 @@ -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 From b4904f882e4931c58ea74aed75b11cdc7fc74be7 Mon Sep 17 00:00:00 2001 From: FrankLeeeee Date: Tue, 7 Feb 2023 11:48:11 +0800 Subject: [PATCH 2/2] polish code --- .txt | 15 --------------- 1 file changed, 15 deletions(-) delete mode 100644 .txt diff --git a/.txt b/.txt deleted file mode 100644 index 0afd0dae85ec..000000000000 --- a/.txt +++ /dev/null @@ -1,15 +0,0 @@ -The code coverage for the changed files is %. - -
-The code coverage for the changed files is %. - -
-The code coverage for the changed files is %. - -
-The code coverage for the changed files is 87%. - -
-The code coverage for the changed files is 87%. - -