generated from MetaMask/metamask-module-template
-
Notifications
You must be signed in to change notification settings - Fork 5
refactor(coverage): Replace per-package thresholds with GitHub Actions workflow #759
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
+98
−153
Merged
Changes from 8 commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
6682455
refactor(coverage): Replace per-package thresholds with GitHub Action…
rekmarks d38ee66
feat(coverage): Add GitHub Pages deployment for HTML coverage report
rekmarks 0beb0a2
Merge branch 'main' into rekm/test-coverage
rekmarks f941bd4
fix: Fix action tags in coverage workflow
rekmarks 7929d75
refactor(coverage): Integrate coverage into main CI and create reusab…
rekmarks d8d4e03
refactor(coverage): Fetch baseline from GitHub Pages instead of cache
rekmarks 64e9d10
fix: Update peaceiris action release tag
rekmarks 206b77a
refactor: Collect coverage in test job
rekmarks 3f9517a
refactor: Address review feedback
rekmarks File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,59 @@ | ||
| name: Coverage Report | ||
|
|
||
| on: | ||
| workflow_call: | ||
|
|
||
| jobs: | ||
| report: | ||
| name: Report | ||
| runs-on: ubuntu-latest | ||
| permissions: | ||
| contents: write | ||
| pull-requests: write | ||
| steps: | ||
| - name: Checkout | ||
| uses: actions/checkout@v6 | ||
|
|
||
| - name: Download coverage artifact | ||
| uses: actions/download-artifact@v7 | ||
| with: | ||
| name: coverage | ||
| path: coverage/ | ||
|
|
||
| # On push to main, deploy HTML coverage report to GitHub Pages | ||
| - name: Deploy coverage to GitHub Pages | ||
| if: github.event_name == 'push' && github.ref == 'refs/heads/main' | ||
| uses: peaceiris/actions-gh-pages@4f9cc6602d3f66b9c108549d475ec49e8ef4d45e | ||
| with: | ||
| github_token: ${{ secrets.GITHUB_TOKEN }} | ||
| publish_dir: ./coverage | ||
| destination_dir: coverage | ||
|
|
||
| # On PRs, fetch baseline coverage from GitHub Pages | ||
| - name: Fetch baseline coverage from GitHub Pages | ||
| if: github.event_name == 'pull_request' | ||
| run: | | ||
| mkdir -p coverage-base | ||
| curl -fsSL https://metamask.github.io/ocap-kernel/coverage/coverage-summary.json \ | ||
| -o coverage-base/coverage-summary.json || echo "No baseline coverage found" && exit 1 | ||
|
|
||
| - name: Post coverage report | ||
| if: github.event_name == 'pull_request' | ||
| uses: davelosert/vitest-coverage-report-action@5b6122e3a819a3be7b27fc961b7faafb3bf00e4d | ||
| with: | ||
| json-summary-path: coverage/coverage-summary.json | ||
| json-final-path: coverage/coverage-final.json | ||
| json-summary-compare-path: coverage-base/coverage-summary.json | ||
| file-coverage-mode: changes | ||
|
|
||
| - name: Post coverage report link | ||
| if: github.event_name == 'pull_request' | ||
| uses: actions/github-script@v8 | ||
| with: | ||
| script: | | ||
| github.rest.issues.createComment({ | ||
| issue_number: context.issue.number, | ||
| owner: context.repo.owner, | ||
| repo: context.repo.repo, | ||
| body: '📊 [View full HTML coverage report for `main`](https://metamask.github.io/ocap-kernel/coverage/)' | ||
| }) | ||
rekmarks marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.