summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--.github/workflows/coverage.yml36
1 files changed, 20 insertions, 16 deletions
diff --git a/.github/workflows/coverage.yml b/.github/workflows/coverage.yml
index aa740fa5..7b5f28ac 100644
--- a/.github/workflows/coverage.yml
+++ b/.github/workflows/coverage.yml
@@ -149,17 +149,6 @@ jobs:
runs-on: ubuntu-latest
steps:
- - name: "Checkout reports repo"
- run: |
- set -xe
- git clone --depth=1 --no-checkout https://${{ secrets.COVERAGE_REPORTS_TOKEN }}@github.com/nedbat/coverage-reports reports_repo
- cd reports_repo
- git sparse-checkout init --cone
- git sparse-checkout set --skip-checks '/*' '!/reports'
- git config user.name nedbat
- git config user.email ned@nedbatchelder.com
- git checkout main
-
- name: "Compute info for later steps"
id: info
run: |
@@ -175,13 +164,32 @@ jobs:
echo "url=https://nedbat.github.io/coverage-reports/$REPORT_DIR" >> $GITHUB_ENV
echo "branch=${REF#refs/heads/}" >> $GITHUB_ENV
+ - name: "Create summary"
+ run: |
+ echo '### Total coverage: ${{ env.total }}%' >> $GITHUB_STEP_SUMMARY
+ echo '[${{ env.url }}](${{ env.url }})' >> $GITHUB_STEP_SUMMARY
+
+ - name: "Checkout reports repo"
+ if: ${{ github.ref == 'refs/heads/master' }}
+ run: |
+ set -xe
+ git clone --depth=1 --no-checkout https://${{ secrets.COVERAGE_REPORTS_TOKEN }}@github.com/nedbat/coverage-reports reports_repo
+ cd reports_repo
+ git sparse-checkout init --cone
+ git sparse-checkout set --skip-checks '/*' '!/reports'
+ git config user.name nedbat
+ git config user.email ned@nedbatchelder.com
+ git checkout main
+
- name: "Download coverage HTML report"
+ if: ${{ github.ref == 'refs/heads/master' }}
uses: actions/download-artifact@v3
with:
name: html_report
path: reports_repo/${{ env.report_dir }}
- name: "Push to report repo"
+ if: ${{ github.ref == 'refs/heads/master' }}
env:
COMMIT_MESSAGE: ${{ github.event.head_commit.message }}
run: |
@@ -204,6 +212,7 @@ jobs:
git push
- name: "Create badge"
+ if: ${{ github.ref == 'refs/heads/master' }}
# https://gist.githubusercontent.com/nedbat/8c6980f77988a327348f9b02bbaf67f5
uses: schneegans/dynamic-badges-action@5d424ad4060f866e4d1dab8f8da0456e6b1c4f56
with:
@@ -215,8 +224,3 @@ jobs:
minColorRange: 60
maxColorRange: 95
valColorRange: ${{ env.total }}
-
- - name: "Create summary"
- run: |
- echo '### Total coverage: ${{ env.total }}%' >> $GITHUB_STEP_SUMMARY
- echo '[${{ env.url }}](${{ env.url }})' >> $GITHUB_STEP_SUMMARY