summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-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 }}"