-
Notifications
You must be signed in to change notification settings - Fork 5
Add GH Actions Workflow for Code Coverage Reporting #272
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
Conversation
Coverage report for
|
St.❔ |
Category | Percentage | Covered / Total |
---|---|---|---|
🟡 | Statements | 76.54% | 62/81 |
🟡 | Branches | 64.29% | 9/14 |
🟡 | Functions | 71.43% | 10/14 |
🟡 | Lines | 75% | 54/72 |
Test suite run success
7 tests passing in 3 suites.
Report generated by 🧪jest coverage report action from db4cd3f
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- uses: ArtiomTr/jest-coverage-report-action@v2 |
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.
Thoughts on folding this into the existing test workflow so it doesn't have to rerun the tests?
To bypass running unit tests, you can pass the filepath to the current report.json
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.
Yeah, I think ultimately we'd want to have it run through only once.
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.
OK, I think I've got it incorporated into the existing workflow such that the only extra work it is doing is the necessary run of tests for the main
branch (for comparison).
branches: | ||
- master | ||
- main |
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.
Should it do this instead, so it runs on any pull request that touches an app file? This is what we do on ci-app.yml
branches: | |
- master | |
- main | |
paths: | |
- app/** | |
- .github/workflows/ci-jest-coverage.yml |
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- uses: ArtiomTr/jest-coverage-report-action@v2 |
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.
I see in their docs that it can "Comparing coverage with base branch". Were you able to test that out or is it dependent on something existing on the base branch first?
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.
Yup, I think we've got that working, though it's difficult to tell in this actual PR since it isn't changing any files that would be covered. As mentioned in this discussion, apparently the spoiler tags w/ more info (& comparisons) only show up if there are relevant files that are changed.
I could add some sort of TS file here in this PR for testing, but I'm more inclined to just try merging this and see how it works on other PRs. Open to other thoughts though!
Coverage report for
|
St.❔ |
Category | Percentage | Covered / Total |
---|---|---|---|
🟡 | Statements | 76.54% | 62/81 |
🟡 | Branches | 64.29% | 9/14 |
🟡 | Functions | 71.43% | 10/14 |
🟡 | Lines | 75% | 54/72 |
Test suite run success
7 tests passing in 3 suites.
Report generated by 🧪jest coverage report action from 3ed541b
Ticket
Resolves #106
Changes
added GH Actions workflow that uses an existing Marketplace script to provide Jest code coverage reports on PRs