Skip to content
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

Generate code coverage reports on PRs #213

Merged
Show file tree
Hide file tree
Changes from 10 commits
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
c25652c
chore: rename test files to `*.test.js`
CyberCitizen01 Jul 27, 2023
ee28b68
feat: add `nyc` to generate test coverage reports
CyberCitizen01 Jul 27, 2023
d68fc19
feat: ci logic to present & block PRs if coverage <80%
CyberCitizen01 Jul 30, 2023
4136628
fix: comment on PR irrespective of test step
CyberCitizen01 Jul 30, 2023
05cf4b2
fix: permissions for GITHUB_TOKEN
CyberCitizen01 Jul 30, 2023
bf712c1
fix: typo in syntax of storing exit code in o/p
CyberCitizen01 Jul 30, 2023
a37a3f6
Merge branch 'main' into 203-implement-code-coverage-reports-on-pull-…
JamieSlome Aug 7, 2023
cc21b82
Merge branch 'main' into 203-implement-code-coverage-reports-on-pull-…
JamieSlome Aug 8, 2023
045a47d
Merge branch 'main' into 203-implement-code-coverage-reports-on-pull-…
CyberCitizen01 Aug 26, 2023
0d81a41
Merge branch 'main' into 203-implement-code-coverage-reports-on-pull-…
CyberCitizen01 Oct 4, 2023
5b1655f
feat: assess coverage report on modified files b/w PR and base ref
CyberCitizen01 Oct 25, 2023
222a3dc
chore(workflows): ignore coverage threshold limit
CyberCitizen01 Oct 25, 2023
b164608
Merge branch 'main' into 203-implement-code-coverage-reports-on-pull-…
CyberCitizen01 Oct 28, 2023
8182d65
Merge branch 'main' into 203-implement-code-coverage-reports-on-pull-…
JamieSlome Oct 31, 2023
5d449e1
chore: update package-lock.json
JamieSlome Oct 31, 2023
36421b7
Merge branch 'main' into 203-implement-code-coverage-reports-on-pull-…
CyberCitizen01 Dec 26, 2023
06964ce
Merge branch 'main' into 203-implement-code-coverage-reports-on-pull-…
JamieSlome Jan 3, 2024
a3e86ed
Merge branch 'main' into 203-implement-code-coverage-reports-on-pull-…
CyberCitizen01 Jan 18, 2024
bf12488
Merge branch 'main' into 203-implement-code-coverage-reports-on-pull-…
JamieSlome Jan 19, 2024
5bbf789
chore: replace `romeovs/lcov-reporter-action` with `zgosalvez/github-…
CyberCitizen01 Jan 22, 2024
e1d6117
fix: failing workflow run `Unable to locate executable file: genhtml`
CyberCitizen01 Jan 22, 2024
b5f00a1
Merge branch 'main' into 203-implement-code-coverage-reports-on-pull-…
JamieSlome Jan 22, 2024
e40cfce
fix: failing workflow run because of missing lcov.info file
CyberCitizen01 Jan 23, 2024
9db4525
chore: `set-ouput` deprecated; use environment files
CyberCitizen01 Jan 23, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 16 additions & 1 deletion .github/workflows/nodejs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,9 @@ jobs:
node-version: [16.x]
mongodb-version: [4.4]

permissions:
pull-requests: write

steps:
- uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608 # v4

Expand All @@ -36,5 +39,17 @@ jobs:
run: npm i

- name: Test
run: npm test
id: test
run: |
npm run test-coverage-ci || echo "exit_code=$?" >> $GITHUB_OUTPUT

- name: Comment test coverage report on PR
uses: romeovs/[email protected]
with:
lcov-file: ./coverage/lcov.info
github-token: ${{ secrets.GITHUB_TOKEN }}
CyberCitizen01 marked this conversation as resolved.
Show resolved Hide resolved

- name: Exit if coverage condition not met
if: ${{ steps.test.outputs.exit_code }} != 0
CyberCitizen01 marked this conversation as resolved.
Show resolved Hide resolved
run: exit ${{ steps.test.outputs.exit_code }}
JamieSlome marked this conversation as resolved.
Show resolved Hide resolved

6 changes: 6 additions & 0 deletions .nycrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"branches": 80,
"lines": 80,
"functions": 80,
"statements": 80
}
Loading