From 5f3677022604f4b82651a6f3d0d04bf2da381e28 Mon Sep 17 00:00:00 2001 From: ashing Date: Tue, 16 Jul 2024 21:53:16 +0800 Subject: [PATCH 1/2] fix: codecov with token Signed-off-by: ashing --- .github/workflows/codecov.yml | 10 +++++++--- README.md | 8 ++++++++ codecov.yml | 8 ++++++++ 3 files changed, 23 insertions(+), 3 deletions(-) create mode 100644 codecov.yml diff --git a/.github/workflows/codecov.yml b/.github/workflows/codecov.yml index 5ff490b..a334245 100644 --- a/.github/workflows/codecov.yml +++ b/.github/workflows/codecov.yml @@ -1,4 +1,4 @@ -name: Go Unit Test +name: Codecov on: push: @@ -30,5 +30,9 @@ jobs: - name: run codecov.sh run: bash scripts/codecov.sh - - name: Publish to codecov.io - run: bash <(curl -s https://codecov.io/bash) + - name: Upload coverage reports to Codecov + uses: codecov/codecov-action@v4.0.1 + with: + token: ${{ secrets.CODECOV_TOKEN }} + flags: unittest + fail_ci_if_error: true diff --git a/README.md b/README.md index e2eeb9c..ba32e88 100644 --- a/README.md +++ b/README.md @@ -4,6 +4,7 @@ - [algorithm-coding](#algorithm-coding) - [coding time](#coding-time) + - [codecov](#codecov) - [stats](#stats) - [acknowledgement](#acknowledgement) @@ -18,6 +19,13 @@ It covers essential topics for technical interviews, providing detailed explanat ![wakatime](https://wakatime.com/badge/user/01c864c3-99e2-47a2-ad28-cc0f36b02f39/project/19417b50-3182-4aca-8dec-a35aa5133c91.svg) +### codecov + +[![codecov](https://codecov.io/github/InterviewTips/algorithm-coding/graph/badge.svg?token=Y099UQ3IBP)](https://codecov.io/github/InterviewTips/algorithm-coding) + +[![codecov](https://codecov.io/github/InterviewTips/algorithm-coding/graphs/icicle.svg?token=Y099UQ3IBP)](https://codecov.io/github/InterviewTips/algorithm-coding) + + ### stats | ![](https://stats.justsong.cn/api/leetcode?username=ashing&cn=true) | ![](https://stats.justsong.cn/api/leetcode?username=ronething) | diff --git a/codecov.yml b/codecov.yml new file mode 100644 index 0000000..49302c0 --- /dev/null +++ b/codecov.yml @@ -0,0 +1,8 @@ +coverage: + status: + project: + default: + target: 75% # the required coverage value + threshold: 1% # the leniency in hitting the target +codecov: + require_ci_to_pass: true From 63fd7e288c140a20df8375d4f557c76e419b435c Mon Sep 17 00:00:00 2001 From: ashing Date: Tue, 16 Jul 2024 22:03:16 +0800 Subject: [PATCH 2/2] fix: r Signed-off-by: ashing --- .github/workflows/codecov.yml | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/.github/workflows/codecov.yml b/.github/workflows/codecov.yml index a334245..fefa907 100644 --- a/.github/workflows/codecov.yml +++ b/.github/workflows/codecov.yml @@ -30,9 +30,7 @@ jobs: - name: run codecov.sh run: bash scripts/codecov.sh - - name: Upload coverage reports to Codecov - uses: codecov/codecov-action@v4.0.1 - with: - token: ${{ secrets.CODECOV_TOKEN }} - flags: unittest - fail_ci_if_error: true + - name: Publish to codecov.io + env: + CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} + run: bash <(curl -s https://codecov.io/bash)