Skip to content

Commit 4ab7bef

Browse files
unhappychoiceclaude
andcommitted
ci: add codecov coverage measurement
Add a coverage job using cargo-llvm-cov that uploads lcov reports to Codecov, along with codecov.yml thresholds and a README badge, mirroring the setup used in gittype. Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
1 parent fa408c4 commit 4ab7bef

3 files changed

Lines changed: 42 additions & 0 deletions

File tree

‎.github/workflows/ci.yml‎

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,28 @@ jobs:
4949
prefix-key: v1-rust
5050
- run: cargo test
5151

52+
coverage:
53+
name: Coverage
54+
runs-on: ubuntu-22.04
55+
steps:
56+
- uses: actions/checkout@v4
57+
- uses: dtolnay/rust-toolchain@stable
58+
with:
59+
components: llvm-tools-preview
60+
- uses: Swatinem/rust-cache@v2
61+
with:
62+
prefix-key: v1-rust
63+
- name: Install cargo-llvm-cov
64+
uses: taiki-e/install-action@cargo-llvm-cov
65+
- name: Generate coverage report
66+
run: cargo llvm-cov --all-features --workspace --lcov --output-path lcov.info
67+
- name: Upload coverage to Codecov
68+
uses: codecov/codecov-action@v3
69+
with:
70+
token: ${{ secrets.CODECOV_TOKEN }}
71+
files: lcov.info
72+
fail_ci_if_error: false
73+
5274
build:
5375
name: Build
5476
strategy:

‎README.md‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
<a href="https://crates.io/crates/gitlogue"><img src="https://img.shields.io/crates/v/gitlogue.svg?style=flat-square&color=E06B4B" alt="crates.io"></a>
77
<a href="https://github.com/unhappychoice/gitlogue/releases"><img src="https://img.shields.io/github/v/release/unhappychoice/gitlogue?style=flat-square&color=E0C14B&label=release" alt="release"></a>
88
<a href="https://github.com/unhappychoice/gitlogue/actions/workflows/ci.yml"><img src="https://img.shields.io/github/actions/workflow/status/unhappychoice/gitlogue/ci.yml?branch=main&style=flat-square&label=CI" alt="CI"></a>
9+
<a href="https://codecov.io/gh/unhappychoice/gitlogue"><img src="https://img.shields.io/codecov/c/github/unhappychoice/gitlogue?style=flat-square" alt="codecov"></a>
910
<a href="https://github.com/unhappychoice/gitlogue/blob/main/LICENSE"><img src="https://img.shields.io/crates/l/gitlogue.svg?style=flat-square" alt="license"></a>
1011
<a href="https://terminaltrove.com/gitlogue/"><img src="https://img.shields.io/badge/Terminal_Trove-Tool_of_The_Week-2ea043?style=flat-square" alt="Terminal Trove Tool of The Week"></a>
1112
</p>

‎codecov.yml‎

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
coverage:
2+
status:
3+
project:
4+
default:
5+
target: 80%
6+
threshold: 1%
7+
patch:
8+
default:
9+
target: 80%
10+
threshold: 1%
11+
12+
ignore:
13+
- "tests/"
14+
- "examples/"
15+
16+
comment:
17+
layout: "reach,diff,flags,tree"
18+
behavior: default
19+
require_changes: false

0 commit comments

Comments
 (0)