]> Nishi Git Mirror - gwion.git/commitdiff
:wrench: Badge script
authorJérémie Astor <astor.jeremie@wanadoo.fr>
Thu, 20 Feb 2020 17:04:40 +0000 (18:04 +0100)
committerJérémie Astor <astor.jeremie@wanadoo.fr>
Thu, 20 Feb 2020 17:04:40 +0000 (18:04 +0100)
.github/workflows/coverage.yml

index ad83440b133d1588f0fd95f955fb49b453203193..f68bb48e26b097c9fe483c80758e95d957dab87f 100644 (file)
@@ -48,7 +48,6 @@ jobs:
         rm -f gwion-coverage-report/*.html
 
     - name: Generate Report
-#      if: github.event_name == 'push'
       run: |
         printf '# Gwion coverage\n```\n' > gwion-coverage-report/README.md
         gcovr -s --filter '.*\.c$' src >> gwion-coverage-report/README.md
@@ -56,15 +55,6 @@ jobs:
         COV_TXT=$(gcovr -s --html-details index.html --html-title "Gwion coverage report" --filter '.*\.c$' src | grep lines | cut -d" " -f2)
         COV_NUM=${COV_TXT: : -1}
         echo $COV_NUM > gwion-coverage-report/coverage_num.txt
-        if [ $(python -c "print( $COV_NUM >= 90 )") = True ]
-        then COLOR=green
-        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 gwion-coverage-report/badge.svg && break
-        done
         sed -i 's/<html>/<script type="text\/javascript" src="focus.js"><\/script><html>/' index.src_*.html
         branch=$(basename ${{ github.event.ref }})
         mkdir -p gwion-coverage-report/html/$branch
@@ -76,6 +66,12 @@ jobs:
         do echo "  * [$(basename $a)](https://fennecdjay.github.com/gwion-coverage-report/$(basename $a))"
         done > README.md
 
+    - name: Make badge
+      if: github.event_name == 'push' && github.event.ref == "refs/heads/master"
+      run: | 
+        cd gwion-coverage-report
+        bash badge.sh
+
     - name: Push Report
       if: github.event_name == 'push'
       run: |