-
Notifications
You must be signed in to change notification settings - Fork 4
Display coverage in Github PR checks #26
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
Merged
Changes from all commits
Commits
Show all changes
20 commits
Select commit
Hold shift + click to select a range
7130964
Run coverage
james-toussaint 58ab469
Move coverage to dedicated workflow
james-toussaint f9cb327
Show coverage logs
james-toussaint 0424e46
Start check-runs output title
james-toussaint dbcb39c
Add summary
james-toussaint 734acb9
Run coverage on PR
james-toussaint 7240686
Remove status
james-toussaint 9f7c8c2
Remove branch
james-toussaint 7569f55
Set completed status
james-toussaint 5d6b37f
Add conclusion
james-toussaint d84389f
Start coverage in title
james-toussaint ec3070e
Add sample coverage
james-toussaint bf73289
Print coverage
james-toussaint d22c338
Test direct coverage env
james-toussaint bc4d1e5
Get coverage from Github env
james-toussaint fbe8f7e
Clean workflow
james-toussaint 6e0ec86
Remove returns in data
james-toussaint 40c4f58
Merge pull request #25 from iExecBlockchainComputing/feature/coverage…
james-toussaint 71d52cd
Add comments
james-toussaint 667f949
Move export
james-toussaint 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,31 @@ | ||
| on: | ||
| pull_request: | ||
| branches: | ||
| - develop | ||
| - main | ||
|
|
||
| jobs: | ||
| coverage: | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - name: Checkout | ||
| uses: actions/checkout@v4 | ||
| - name: Init | ||
| run: npm ci | ||
| - name: Run Coverage | ||
| run: (npm run coverage 2>&1) | tee /tmp/coverage.out | cat | ||
| - name: Extract coverage | ||
| run: echo "COVERAGE=$(cat /tmp/coverage.out | grep "Global test coverage")" >> $GITHUB_ENV | ||
| - name: Display coverage in Github PR checks | ||
| # See https://docs.github.com/en/rest/checks/runs?apiVersion=2022-11-28#create-a-check-run | ||
| # and https://www.kenmuse.com/blog/creating-github-checks/ | ||
| env: | ||
| GH_TOKEN: ${{ github.token }} | ||
| run: | # TODO: Set "failure" conclusion if coverage is too low | ||
| curl -L -X POST \ | ||
| -H "Accept: application/vnd.github+json" \ | ||
| -H "Authorization: Bearer $GH_TOKEN"\ | ||
| -H "X-GitHub-Api-Version: 2022-11-28" \ | ||
| https://api.github.com/repos/${{ github.repository }}/check-runs \ | ||
| -d '{"name":"Coverage ratio", "head_sha":"${{ github.event.pull_request.head.sha }}", "status":"completed", "conclusion":"success", "output":{"title":"${{env.COVERAGE}}", "summary":""}}' | ||
|
|
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 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
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice