There was an error while loading. Please reload this page.
1 parent 53d152b commit c1a8cfcCopy full SHA for c1a8cfc
1 file changed
.github/workflows/test.yml
@@ -20,6 +20,21 @@ jobs:
20
- name: Run tests with coverage # 复用仓库原有的 gotest.sh,生成 coverage.txt
21
run: bash ./gotest.sh
22
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
33
+ uses: actions/upload-artifact@v4
34
+ with:
35
+ name: coverage-profile
36
+ path: coverage.txt
37
38
- name: Upload coverage to Codecov
39
uses: codecov/codecov-action@v4
40
with:
0 commit comments