]> Nishi Git Mirror - gwion.git/commitdiff
:wrench: badge and other stuff
authorJérémie Astor <astor.jeremie@wanadoo.fr>
Sun, 16 Feb 2020 17:34:46 +0000 (18:34 +0100)
committerJérémie Astor <astor.jeremie@wanadoo.fr>
Sun, 16 Feb 2020 17:34:46 +0000 (18:34 +0100)
.github/workflows/coverage.yml

index dd906823548716245ec6eee07452fdc2b47e4e45..49cd73bb410483bc1cfb0a32e2bbed305a7bb933 100644 (file)
@@ -37,16 +37,19 @@ jobs:
     - name: Install gcovr
       run: |
          pip install git+https://github.com/gcovr/gcovr.git
-#      run: |
-#        sudo apt-get update
-#        sudo apt-get install gcovr
 
     - name: Generate Report
       run: |
-        gcovr -h
         COV_TXT=$(gcovr -s --html-details cov.html | grep lines | cut -d" " -f2)
         COV_NUM=${COV_TXT: : -1}
-        echo $COV_NUM
+        if [ $COV_NUM -ge 90 ]
+        then COLOR=green
+        elif [ $COV_NUM -ge 90 ]
+        then COLOR=yellow
+        else COLOR=red
+        fi
+        wget https://badgen.net/badge/coverage/$COV_TXT/$COLOR -O badge.svg
+        echo $COV_NUM $COLOR
         ls
 
     - name: Push Report
@@ -55,6 +58,7 @@ jobs:
         cd gwion-coverage-report
         rm -f *.html
         cp ../*.html .
+        cp ../badge.svg .
         mv cov.html index.html
         ls
         cat index.html