push:
branches:
- 'master'
+ pull_request:
+ branches:
+ - 'master'
jobs:
build:
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 ]
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