Skip to content

Commit

Permalink
🔧 Update
Browse files Browse the repository at this point in the history
  • Loading branch information
fennecdjay committed Feb 16, 2020
1 parent 1e63978 commit bef23a2
Showing 1 changed file with 10 additions and 11 deletions.
21 changes: 10 additions & 11 deletions .github/workflows/coverage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,30 +38,29 @@ jobs:
run: |
pip install git+https://github.com/gcovr/gcovr.git
- name: Clone report repo
run: |
git clone https://github.com/fennecdjay/gwion-coverage-report
rm -f gwion-coverage-report/*.html
- name: Generate Report
run: |
COV_TXT=$(gcovr -s --html-details cov.html --filter '.*\.c$' src | grep lines | cut -d" " -f2)
COV_TXT=$(gcovr -s --html-details gwion-coverage-report/index.html --filter '.*\.c$' src | grep lines | cut -d" " -f2)
COV_NUM=${COV_TXT: : -1}
COV_INT=${COV_NUM: : -2}
if [ $COV_INT -ge 90 ]
echo $COV_NUM > gwion-coverage-report/coverage_num.txt
if [ $(python -c "print( $COV_NUM >= 90 )") = True ]
then COLOR=green
elif [ $COV_INT -ge 75 ]
elif [ $(python -c "print( $COV_NUM >= 75 )") = True ]
then COLOR=yellow
else COLOR=red
fi
while true
do wget https://badgen.net/badge/coverage/$COV_NUM/$COLOR -O badge.svg && break
do wget https://badgen.net/badge/coverage/$COV_NUM/$COLOR -O gwion-coverage-report/badge.svg && break
done
- name: Push Report
run: |
git clone https://github.com/fennecdjay/gwion-coverage-report
cd gwion-coverage-report
rm -f *.html *.svg
cp ../*.html .
convert -size 1024x1024 ../badge.svg badge.png
cp ../badge.svg badge.svg
mv cov.html index.html
git config --local user.email "action@github.com"
git config --local user.name "GitHub Action"
git add .
Expand Down

0 comments on commit bef23a2

Please sign in to comment.