Skip to content

Commit

Permalink
Setup code coverage report to github action (#62)
Browse files Browse the repository at this point in the history
  • Loading branch information
lkostrowski authored Sep 16, 2022
1 parent 117b1e6 commit df504ec
Show file tree
Hide file tree
Showing 4 changed files with 232 additions and 2 deletions.
15 changes: 14 additions & 1 deletion .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,20 @@ jobs:
- name: Install dependencies
run: pnpm install
- name: Test
run: pnpm test
run: pnpm test:ci
- name: Generate coverage report
uses: irongut/[email protected]
with:
filename: coverage/cobertura-coverage.xml
format: markdown
output: file

- name: Add Coverage PR Comment
uses: marocchino/sticky-pull-request-comment@v2
if: github.event_name == 'pull_request'
with:
recreate: true
path: code-coverage-results.md

build:
runs-on: ubuntu-latest
Expand Down
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
"build": "tsup-node src/* --format esm,cjs --dts && clear-package-json package.json -o dist/package.json --fields publishConfig",
"clean": "rm -rf ./dist/*",
"test": "vitest",
"test:ci": "CI=true vitest",
"test:ci": "CI=true vitest --coverage",
"prepare": "husky install",
"lint": "prettier --loglevel warn --write . && eslint --fix .",
"release": "release-it"
Expand All @@ -32,6 +32,7 @@
"uuid": "^8.3.2"
},
"devDependencies": {
"@vitest/coverage-c8": "^0.23.2",
"@testing-library/dom": "^8.17.1",
"@testing-library/react": "^13.4.0",
"@types/debug": "^4.1.7",
Expand Down
Loading

0 comments on commit df504ec

Please sign in to comment.