mirror of
https://github.com/jefferyjob/go-easy-utils.git
synced 2025-09-27 03:15:55 +08:00
codecov:Test Analytics (#86)
https://docs.codecov.com/docs/test-result-ingestion-beta#failed-test-reporting
This commit is contained in:
18
.github/workflows/Go.yml
vendored
18
.github/workflows/Go.yml
vendored
@@ -38,3 +38,21 @@ jobs:
|
|||||||
uses: codecov/codecov-action@v4
|
uses: codecov/codecov-action@v4
|
||||||
with:
|
with:
|
||||||
token: ${{secrets.CODECOV_TOKEN}}
|
token: ${{secrets.CODECOV_TOKEN}}
|
||||||
|
|
||||||
|
# 安装依赖项
|
||||||
|
- name: Install dependencies
|
||||||
|
run: |
|
||||||
|
go install github.com/jstemmer/go-junit-report@latest
|
||||||
|
go install gotest.tools/gotestsum@latest
|
||||||
|
|
||||||
|
# 运行测试并生成覆盖率报告
|
||||||
|
- name: Run tests and generate coverage report
|
||||||
|
run: gotestsum --junitfile junit.xml
|
||||||
|
|
||||||
|
# 上传测试结果到 Codecov
|
||||||
|
- name: Upload test results to Codecov
|
||||||
|
if: ${{ !cancelled() }}
|
||||||
|
uses: codecov/test-results-action@v1
|
||||||
|
with:
|
||||||
|
token: ${{ secrets.CODECOV_TOKEN }}
|
||||||
|
|
||||||
|
1
.gitignore
vendored
1
.gitignore
vendored
@@ -12,6 +12,7 @@
|
|||||||
*.test
|
*.test
|
||||||
coverage.out
|
coverage.out
|
||||||
coverage.txt
|
coverage.txt
|
||||||
|
junit.xml
|
||||||
|
|
||||||
# Output of the go coverage tool, specifically when used with LiteIDE
|
# Output of the go coverage tool, specifically when used with LiteIDE
|
||||||
*.out
|
*.out
|
||||||
|
Reference in New Issue
Block a user