Skip to content

Commit 5c265f2

Browse files
author
Dias, Diego
committed
Deploy coverage reports to GitHub Pages for browser viewing
- Add peaceiris/actions-gh-pages to deploy HTML reports - Coverage reports accessible at github.io URL per branch - Add coverage report link to GitHub Actions summary - No need to download artifacts, view directly in browser
1 parent 64d8f8e commit 5c265f2

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

.github/workflows/test-coverage.yml

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,14 @@ jobs:
3838
name: coverage-report
3939
path: coverage/jest-tests/
4040

41+
- name: Deploy Coverage Report to GitHub Pages
42+
uses: peaceiris/actions-gh-pages@v4
43+
if: always() && github.event_name == 'push'
44+
with:
45+
github_token: ${{ secrets.GITHUB_TOKEN }}
46+
publish_dir: ./coverage/jest-tests
47+
destination_dir: coverage/${{ github.ref_name }}
48+
4149
- name: Jest Coverage Comment
4250
uses: MishaKav/jest-coverage-comment@main
4351
if: always()
@@ -46,3 +54,10 @@ jobs:
4654
title: Jest Coverage Report
4755
badge-title: Coverage
4856
create-new-comment: false
57+
58+
- name: Coverage Report Link
59+
if: always() && github.event_name == 'push'
60+
run: |
61+
echo "## 🔗 Coverage Report Link" >> $GITHUB_STEP_SUMMARY
62+
echo "" >> $GITHUB_STEP_SUMMARY
63+
echo "📊 [View HTML Coverage Report](https://${{ github.repository_owner }}.github.io/Module-Structuring-and-Testing-Data/coverage/${{ github.ref_name }}/)" >> $GITHUB_STEP_SUMMARY

0 commit comments

Comments
 (0)