Skip to content

Commit c1a8cfc

Browse files
committed
Update test.yml
1 parent 53d152b commit c1a8cfc

1 file changed

Lines changed: 15 additions & 0 deletions

File tree

.github/workflows/test.yml

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,21 @@ jobs:
2020
- name: Run tests with coverage # 复用仓库原有的 gotest.sh,生成 coverage.txt
2121
run: bash ./gotest.sh
2222

23+
- name: Show coverage gaps # 在日志里打印总覆盖率 + 所有未达 100% 的函数,方便定位
24+
if: always()
25+
run: |
26+
echo "===== TOTAL ====="
27+
go tool cover -func=coverage.txt | tail -n 1
28+
echo "===== functions below 100% ====="
29+
go tool cover -func=coverage.txt | grep -v '100.0%' || true
30+
31+
- name: Upload coverage profile # 把 coverage.txt 作为构建产物,可在 run 页面 Artifacts 下载后发我
32+
if: always()
33+
uses: actions/upload-artifact@v4
34+
with:
35+
name: coverage-profile
36+
path: coverage.txt
37+
2338
- name: Upload coverage to Codecov
2439
uses: codecov/codecov-action@v4
2540
with:

0 commit comments

Comments
 (0)