]> Nishi Git Mirror - gwion.git/commitdiff
:wrench: Fix coverage
authorJérémie Astor <astor.jeremie@wanadoo.fr>
Thu, 20 Feb 2020 21:36:51 +0000 (22:36 +0100)
committerJérémie Astor <astor.jeremie@wanadoo.fr>
Thu, 20 Feb 2020 21:36:51 +0000 (22:36 +0100)
.github/workflows/coverage.yml

index 37428670480a4cb310b418dd783eda8ccc1ff45d..48d49358a4f3662e679394dd6a3c2ee6f6554016 100644 (file)
@@ -57,11 +57,13 @@ jobs:
         echo $COV_NUM > gwion-coverage-report/coverage_num.txt
         sed -i 's/<html>/<script type="text\/javascript" src="focus.js"><\/script><html>/' index.src_*.html
         branch=$(basename ${{ github.event.ref }})
-        gcovr --filter '.*\.c$' src > lines.txt
-        gcovr --filter '.*\.c$' --branches src > branches.txt
         cd gwion-coverage-report/
         bash old.sh $branch
         bash summary.sh
+        cd ..
+        gcovr --filter '.*\.c$' src > gwion-coverage-report/html/$branch/lines.txt
+        gcovr --filter '.*\.c$' --branches src > gwion-coverage-report/html/$branch/branches.txt
+        mv *.html gwion-coverage-report/html/$branch
 
     - name: Make badge
       if: github.event_name == 'push' && github.event.ref == 'refs/heads/master'
@@ -69,28 +71,17 @@ jobs:
         cd gwion-coverage-report
         bash badge.sh
 
-    - name: git config
-      if: github.event_name == 'push' && github.event.ref == 'refs/heads/master'
+    - name: Push Report
+      if: github.event_name == 'push'
       run: |
         cd gwion-coverage-report
         git config --local user.email "action@github.com"
         git config --local user.name "GitHub Action"
         git remote set-url origin https://${{ secrets.COVERAGE_TOKEN }}@github.com/fennecdjay/gwion-coverage-report.git
-
-    - name: Push Report
-      if: github.event_name == 'push' && github.event.ref == 'refs/heads/master'
-      run: |
-        cd gwion-coverage-report
         git add README.md coverage_num.txt
         git commit -m "Update coverage" || true
         git push || true
-
-    - name: Push Pages
-      if: github.event_name == 'push'
-      run: |
-        cd gwion-coverage-report
-        rm -r html
-        mv *.html *.txt gwion-coverage-report/html/$branch
+        git push origin :gh-pages || true
         cp focus.js html
         git add -f html
         git commit -m "Update html report"