Skip to content

Commit

Permalink
Coverage badge
Browse files Browse the repository at this point in the history
  • Loading branch information
agsh committed May 16, 2024
1 parent 08f6535 commit 98f9915
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 3 deletions.
20 changes: 20 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
name: Test
on: [push, pull_request, workflow_dispatch]
jobs:
test:
runs-on: ubuntu-latest
steps:
# Your original steps
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
- name: Install
run: npm install
- name: Test and Coverage
run: npm run coverage

# Add this
- name: Update Coverage Badge
# GitHub actions: default branch variable
# https://stackoverflow.com/questions/64781462/github-actions-default-branch-variable
if: github.ref == format('refs/heads/{0}', github.event.repository.default_branch)
uses: we-cli/coverage-badge-action@main
5 changes: 2 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,14 @@
"typings": "lib/yapople.d.ts",
"scripts": {
"test": "jest --coverage",
"coveralls": "jest --coverage && cat ./coverage/lcov.info | coveralls"
"coverage": "jest --coverage"
},
"repository": {
"type": "git",
"url": "https://github.com/agsh/yapople.git"
},
"dependencies": {
"mailparser": "^0.5.1"
"mailparser": "*"
},
"keywords": [
"email",
Expand All @@ -28,7 +28,6 @@
"node": ">=5.10"
},
"devDependencies": {
"coveralls": "^3.1.0",
"eslint": "^7.7.0",
"eslint-config-standard": "^14.1.1",
"eslint-plugin-import": "^2.22.0",
Expand Down

0 comments on commit 98f9915

Please sign in to comment.