diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index cb8e92023..389d4680e 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -3,7 +3,7 @@ name: CI on: push: branches: [main, master] - tags: ['v*'] + tags: ["v*"] pull_request: branches: [main, master] @@ -71,7 +71,23 @@ jobs: - name: Run tests with coverage if: github.ref == 'refs/heads/main' - run: cargo llvm-cov nextest --workspace --json --output-path coverage.json -E 'not (test(/live/) | test(/integration/))' + run: cargo llvm-cov nextest --workspace --json --output-path coverage.json --html --output-path coverage-html -E 'not (test(/live/) | test(/integration/))' + + - name: Upload coverage HTML report + if: github.ref == 'refs/heads/main' + uses: actions/upload-artifact@v4 + with: + name: coverage-html + path: coverage-html/ + + - name: Publish coverage HTML to GitHub Pages + if: github.ref == 'refs/heads/main' + uses: peaceiris/actions-gh-pages@v4 + with: + github_token: ${{ secrets.GITHUB_TOKEN }} + publish_dir: ./coverage-html + destination_dir: coverage-html + keep_files: true - name: Generate and deploy coverage badge if: github.ref == 'refs/heads/main'