]> Nishi Git Mirror - gwion.git/commitdiff
:wrench: Update
authorJérémie Astor <astor.jeremie@wanadoo.fr>
Sun, 16 Feb 2020 20:03:59 +0000 (21:03 +0100)
committerJérémie Astor <astor.jeremie@wanadoo.fr>
Sun, 16 Feb 2020 20:03:59 +0000 (21:03 +0100)
.github/workflows/coverage.yml

index bee051daea8067d31c3712fc6e3f41a4fc96d17b..57e6dd9cf66e822c3437ef1e6e37c7bc7eab93d3 100644 (file)
@@ -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 .