From bef23a2fdc975d5b467a9a27b58551811b2a1181 Mon Sep 17 00:00:00 2001 From: =?utf8?q?J=C3=A9r=C3=A9mie=20Astor?= Date: Sun, 16 Feb 2020 21:03:59 +0100 Subject: [PATCH] :wrench: Update --- .github/workflows/coverage.yml | 21 ++++++++++----------- 1 file changed, 10 insertions(+), 11 deletions(-) diff --git a/.github/workflows/coverage.yml b/.github/workflows/coverage.yml index bee051da..57e6dd9c 100644 --- a/.github/workflows/coverage.yml +++ b/.github/workflows/coverage.yml @@ -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 . -- 2.43.0