File tree Expand file tree Collapse file tree 2 files changed +44
-0
lines changed
Expand file tree Collapse file tree 2 files changed +44
-0
lines changed Original file line number Diff line number Diff line change 1919 - test-macos
2020 - test-windows
2121 - lint
22+ - coverage
2223 steps :
2324 - run : exit 0
2425
9899 - name : Format check
99100 run : |
100101 cargo fmt -- --check
102+
103+ cov :
104+ runs-on : ubuntu-latest
105+ timeout-minutes : 40
106+ permissions :
107+ contents : read
108+ checks : write
109+ pull-requests : write
110+
111+ steps :
112+ - uses : actions/checkout@v4
113+ - uses : dtolnay/rust-toolchain@stable
114+ - uses : taiki-e/install-action@v2
115+ with :
116+ tool : cargo-llvm-cov
117+
118+ - name : Generate coverage (LCOV + HTML)
119+ run : |
120+ cargo llvm-cov --workspace --all-features --doctests \
121+ --lcov --output-path lcov.info
122+ cargo llvm-cov --workspace --all-features --doctests --html
123+
124+ - uses : actions/upload-artifact@v4
125+ with :
126+ name : coverage-html
127+ path : target/llvm-cov/html
128+
129+ - name : Upload to Codecov
130+ uses : codecov/codecov-action@v4
131+ with :
132+ files : lcov.info
133+ fail_ci_if_error : true
134+ verbose : true
Original file line number Diff line number Diff line change 1+ coverage :
2+ status :
3+ project : # 可选:总覆盖率门禁(想只卡 patch 也行)
4+ default :
5+ informational : true # 仅展示,不卡死 CI(想卡就设 false 并配 target)
6+ patch :
7+ default :
8+ target : 70% # 新增/修改的 diff 区域覆盖率必须 ≥ 70%
9+ threshold : 0% # 不允许低于目标(留有回旋可设 2% 之类)
10+ informational : false # 失败时让检查变红,阻止合并(配合分支保护)
You can’t perform that action at this time.
0 commit comments