Skip to content

Commit 299d25a

Browse files
authored
Merge pull request #8 from cuteolaf/ci/test-coverage
feat: CI publish HTML test coverage report to GitHub Pages
2 parents 8ecab04 + 1155c72 commit 299d25a

File tree

1 file changed

+18
-2
lines changed

1 file changed

+18
-2
lines changed

.github/workflows/ci.yml

Lines changed: 18 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ name: CI
33
on:
44
push:
55
branches: [main, master]
6-
tags: ['v*']
6+
tags: ["v*"]
77
pull_request:
88
branches: [main, master]
99

@@ -71,7 +71,23 @@ jobs:
7171

7272
- name: Run tests with coverage
7373
if: github.ref == 'refs/heads/main'
74-
run: cargo llvm-cov nextest --workspace --json --output-path coverage.json -E 'not (test(/live/) | test(/integration/))'
74+
run: cargo llvm-cov nextest --workspace --json --output-path coverage.json --html --output-path coverage-html -E 'not (test(/live/) | test(/integration/))'
75+
76+
- name: Upload coverage HTML report
77+
if: github.ref == 'refs/heads/main'
78+
uses: actions/upload-artifact@v4
79+
with:
80+
name: coverage-html
81+
path: coverage-html/
82+
83+
- name: Publish coverage HTML to GitHub Pages
84+
if: github.ref == 'refs/heads/main'
85+
uses: peaceiris/actions-gh-pages@v4
86+
with:
87+
github_token: ${{ secrets.GITHUB_TOKEN }}
88+
publish_dir: ./coverage-html
89+
destination_dir: coverage-html
90+
keep_files: true
7591

7692
- name: Generate and deploy coverage badge
7793
if: github.ref == 'refs/heads/main'

0 commit comments

Comments
 (0)