From d4b3fd8ef2eea8e63969444839ad375b8ca76814 Mon Sep 17 00:00:00 2001 From: =?utf8?q?J=C3=A9r=C3=A9mie=20Astor?= Date: Mon, 17 Feb 2020 20:42:41 +0100 Subject: [PATCH] :wrench: use html dir --- .github/workflows/coverage.yml | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/.github/workflows/coverage.yml b/.github/workflows/coverage.yml index 990f929b..31409176 100644 --- a/.github/workflows/coverage.yml +++ b/.github/workflows/coverage.yml @@ -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 -- 2.43.0