From 4d05badaf81a269f6e00cc3a477921a72c17afc0 Mon Sep 17 00:00:00 2001 From: yeonjuan Date: Sun, 15 Jan 2023 22:18:01 +0900 Subject: [PATCH 1/3] chore: add codecov --- .codecov.yml | 13 +++++++++++++ .github/workflows/main.yml | 7 +++++++ package.json | 2 +- 3 files changed, 21 insertions(+), 1 deletion(-) create mode 100644 .codecov.yml diff --git a/.codecov.yml b/.codecov.yml new file mode 100644 index 0000000..4ed69a3 --- /dev/null +++ b/.codecov.yml @@ -0,0 +1,13 @@ +coverage: + status: + patch: + default: + target: 90% + project: + default: + target: auto + threshold: 2% +comment: + layout: 'diff, flags, files' + behavior: new + require_changes: false diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 5c5a24c..d337190 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -12,3 +12,10 @@ jobs: - uses: borales/actions-yarn@v2.3.0 with: cmd: check:all + - name: Code coverage report + uses: codecov/codecov-action@v2 + with: + yml: ./codecov.yml + token: ${{ secrets.CODECOV_TOKEN }} + flags: unittest + name: codecov diff --git a/package.json b/package.json index 4309723..a56c2aa 100644 --- a/package.json +++ b/package.json @@ -9,7 +9,7 @@ "prepublish": "yarn build", "build": "rimraf build && rollup -c rollup.config.js && tsc --declaration", "format": "prettier . --write", - "test": "jest", + "test": "jest --coverage", "prebuild": "yarn check:all", "publish:demo": "gh-pages -d demo", "check:all": "prettier --check . && tsc --noEmit && yarn test", From 329b5cb909434bddf3a6b592c4a27bae7b3f150e Mon Sep 17 00:00:00 2001 From: yeonjuan Date: Sun, 15 Jan 2023 22:21:38 +0900 Subject: [PATCH 2/3] fix --- .github/workflows/main.yml | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index d337190..136db72 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -1,15 +1,19 @@ name: CI -on: [push, pull_request] +on: [push] jobs: build: name: Test runs-on: ubuntu-latest steps: - uses: actions/checkout@v2 - - uses: borales/actions-yarn@v2.3.0 + - name: set node.js 16.x + uses: actions/setup-node@v3 + with: + node-version: 16.x + - uses: borales/actions-yarn@v4 with: cmd: install - - uses: borales/actions-yarn@v2.3.0 + - uses: borales/actions-yarn@v4 with: cmd: check:all - name: Code coverage report From 028049087b07e8415aff6277209c1443e2cb11aa Mon Sep 17 00:00:00 2001 From: yeonjuan Date: Sun, 15 Jan 2023 22:24:19 +0900 Subject: [PATCH 3/3] fix --- .github/workflows/main.yml | 2 +- README.md | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 136db72..404c8ed 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -2,7 +2,7 @@ name: CI on: [push] jobs: build: - name: Test + name: CI runs-on: ubuntu-latest steps: - uses: actions/checkout@v2 diff --git a/README.md b/README.md index d515613..64cf442 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,7 @@ ![action status](https://github.com/yeonjuan/parse-git-diff/actions/workflows/main.yml/badge.svg?branch=main) [![npm version](https://badge.fury.io/js/parse-git-diff.svg)](https://www.npmjs.com/package/parse-git-diff) [![license](https://img.shields.io/badge/License-MIT-yellow.svg)](./LICENSE) +[![codecov](https://codecov.io/gh/yeonjuan/parse-git-diff/branch/main/graph/badge.svg?token=J1FUY9P07I)](https://codecov.io/gh/yeonjuan/parse-git-diff) # parse-git-diff