Skip to content

Commit

Permalink
feat: add automated github action to generage coverage report
Browse files Browse the repository at this point in the history
  • Loading branch information
nishantwrp committed Nov 10, 2023
1 parent 0142970 commit 4bcd7fc
Show file tree
Hide file tree
Showing 4 changed files with 29 additions and 1 deletion.
25 changes: 25 additions & 0 deletions .github/workflows/coverage.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
name: Coverage Report
on:
push:
branches:
- master

jobs:
coverage:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest]
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v1
- name: Install dependencies
run: npm install
- name: Generage coverage report
run: npm run coverage
- name: push changes to remote
run: |
git config --global user.name "Albus"
git config --global user.email "[email protected]"
git add .; git commit -m "chore: update coverage report"
git push
1 change: 1 addition & 0 deletions .npmignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,4 @@
tsconfig.json
webpack.config.js
.env
/coverage
3 changes: 2 additions & 1 deletion jest.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,6 @@ module.exports = {
"^@templates/(.*)$": "<rootDir>/src/$1",
"^api$": "<rootDir>/tests/mock-joplin-api.ts"
},
globalSetup: "./tests/jest-setup.js"
globalSetup: "./tests/jest-setup.js",
collectCoverageFrom: ["src/**/*.{js,ts}"]
};
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
"lint": "eslint '{src,tests}/**/*.{ts,json}'",
"release": "standard-version",
"test": "jest",
"coverage": "jest --coverage",
"announce": "node scripts/announceRelease.js",
"postpublish": "npm run announce"
},
Expand Down

0 comments on commit 4bcd7fc

Please sign in to comment.