]> Nishi Git Mirror - gwion.git/commitdiff
:wrench: use html dir
authorJérémie Astor <astor.jeremie@wanadoo.fr>
Mon, 17 Feb 2020 19:42:41 +0000 (20:42 +0100)
committerJérémie Astor <astor.jeremie@wanadoo.fr>
Mon, 17 Feb 2020 19:42:49 +0000 (20:42 +0100)
.github/workflows/coverage.yml

index 990f929b47d8a8b007183fc25695a7bf3d841c57..314091764316a5b50c0744ed7ba92c9cf2bf9f0d 100644 (file)
@@ -5,6 +5,9 @@ on:
   push:
     branches:    
     - 'master'
+  pull_request:
+    branches:    
+    - 'master'
 
 jobs:
   build:
@@ -47,7 +50,8 @@ jobs:
         printf '# Gwion coverage\n```\n' > gwion-coverage-report/README.md
         gcovr -s --filter '.*\.c$' src >> gwion-coverage-report/README.md
         printf '```\n' >> gwion-coverage-report/README.md
-        COV_TXT=$(gcovr -s --html-details gwion-coverage-report/index.html --html-title "Gwion coverage report" --filter '.*\.c$' src | grep lines | cut -d" " -f2)
+        mkdir gwion-coverage-report/html
+        COV_TXT=$(gcovr -s --html-details gwion-coverage-report/html/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 ]
@@ -69,7 +73,11 @@ jobs:
         cd gwion-coverage-report
         git config --local user.email "action@github.com"
         git config --local user.name "GitHub Action"
-        git add . 
-        git commit -m "Update coverage"
         git remote set-url origin https://${{ secrets.COVERAGE_TOKEN }}@github.com/fennecdjay/gwion-coverage-report.git
-        git push origin
+        git add README.md coverage_num.txt
+        git commit -m "Update coverage"
+        git push
+        git add -f html
+        git commit -m "Update html report"
+        git push origin :gh-pages || true
+        git subtree push --prefix html origin gh-pages