summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNed Batchelder <ned@nedbatchelder.com>2021-02-21 20:05:04 -0500
committerNed Batchelder <ned@nedbatchelder.com>2021-02-21 20:54:17 -0500
commit72baa75af0db9455ae981731897957872c8cc6bb (patch)
treec6a632a6ae27117467062eb9ecaea843547aaa87
parentfeb0bb76c6bc3dddcbc3a1c16c189a538729ac0c (diff)
downloadpython-coveragepy-git-72baa75af0db9455ae981731897957872c8cc6bb.tar.gz
build: create an HTML file to redirect to the coverage report
-rw-r--r--.github/workflows/coverage.yml25
1 files changed, 21 insertions, 4 deletions
diff --git a/.github/workflows/coverage.yml b/.github/workflows/coverage.yml
index 5727559a..60ae9e03 100644
--- a/.github/workflows/coverage.yml
+++ b/.github/workflows/coverage.yml
@@ -120,11 +120,16 @@ jobs:
name: html_report
path: htmlcov
- - name: Get information for URL
- id: info
+ - name: Create slug
+ id: slug
run: |
echo "::set-output name=slug::$(date +'%Y%m%d')_$(echo ${{github.sha}} | cut -c 1-12)"
+ - name: Create URL
+ id: url
+ run: |
+ echo "::set-output name=url::https://nedbat.github.io/coverage-reports/reports/${{ steps.slug.outputs.slug }}/htmlcov"
+
- name: Pushes to another repository
uses: sebastian-palma/github-action-push-to-another-repository@allow-creating-destination-directory
env:
@@ -133,13 +138,25 @@ jobs:
source-directory: 'htmlcov'
destination-github-username: 'nedbat'
destination-repository-name: 'coverage-reports'
- destination-repository-directory: 'reports/${{ steps.info.outputs.slug }}'
+ destination-repository-directory: 'reports/${{ steps.slug.outputs.slug }}'
empty-repository: false
create-destination-directory: true
target-branch: main
commit-message: "Coverage report for ${{ github.sha }}"
user-email: ned@nedbatchelder.com
+ - name: Create redirection HTML file
+ run: |
+ echo "<html><head>" > coverage-report-redirect.html
+ echo "<meta http-equiv='refresh' content='0;url=${{ steps.url.outputs.url }}' />" >> coverage-report-redirect.html
+ echo "<body>Coverage report redirect..." >> coverage-report-redirect.html
+
+ - name: "Upload HTML redirect"
+ uses: actions/upload-artifact@v2
+ with:
+ name: coverage-report-redirect.html
+ path: coverage-report-redirect.html
+
- name: Show link to report
run: |
- echo "https://nedbat.github.io/coverage-reports/reports/${{ steps.info.outputs.slug }}/htmlcov"
+ echo "Coverage report: ${{ steps.url.outputs.url }}"