From cc7a9a97fb7248d2ee689d58ec5a0be265deac64 Mon Sep 17 00:00:00 2001 From: Liam Date: Wed, 12 Nov 2025 18:15:43 -0500 Subject: [PATCH 1/2] Track code coverage metrics --- .github/workflows/ci.yaml | 27 +++++++++++++++++++++++++++ README.md | 4 +++- 2 files changed, 30 insertions(+), 1 deletion(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index e388f35..b1ba7a7 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -16,6 +16,33 @@ env: RUSTFLAGS: --deny warnings jobs: + coverage: + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v4 + + - uses: actions-rust-lang/setup-rust-toolchain@v1 + with: + components: llvm-tools-preview + + - uses: Swatinem/rust-cache@v2 + + - uses: taiki-e/install-action@v2 + with: + tool: cargo-llvm-cov + + - name: Generate coverage report + run: cargo llvm-cov --workspace --all-features --all-targets --lcov --output-path lcov.info + + - name: Upload coverage reports to Codecov + uses: codecov/codecov-action@v5 + with: + token: ${{ secrets.CODECOV_TOKEN }} + files: lcov.info + flags: unit + fail_ci_if_error: true + lint: runs-on: ubuntu-latest diff --git a/README.md b/README.md index 958b30b..07f1a3b 100644 --- a/README.md +++ b/README.md @@ -1,8 +1,10 @@ ## present +[![release](https://img.shields.io/github/release/terror/present.svg?label=release&style=flat&labelColor=282c34&logo=github)](https://github.com/terror/present/releases/latest) [![CI](https://github.com/terror/present/actions/workflows/ci.yaml/badge.svg)](https://github.com/terror/present/actions/workflows/ci.yaml) +[![codecov](https://codecov.io/gh/terror/present/graph/badge.svg?token=7CH4XDXO7Z)](https://codecov.io/gh/terror/present) [![crates.io](https://shields.io/crates/v/present.svg)](https://crates.io/crates/present) -[![docs.rs](https://img.shields.io/docsrs/present)](https://docs.rs/present) +[![downloads](https://img.shields.io/crates/d/present)](https://crates.io/crates/present) [![dependency status](https://deps.rs/repo/github/terror/present/status.svg)](https://deps.rs/repo/github/terror/present) **present** is a tool that lets you interpolate the standard output of arbitrary From 344b3b35f5c58b6558c20215d03d17d84f394b2a Mon Sep 17 00:00:00 2001 From: Liam Date: Wed, 12 Nov 2025 18:18:28 -0500 Subject: [PATCH 2/2] Tweak --- README.md | 51 ++++++++++++++++++++++++++++----------------------- 1 file changed, 28 insertions(+), 23 deletions(-) diff --git a/README.md b/README.md index 07f1a3b..593371b 100644 --- a/README.md +++ b/README.md @@ -84,9 +84,10 @@ fn main() { ``` > The above snippet is tested with rustdoc. A really cool side effect of this, -is that the test loads the README itself, and runs `present` over it. `present` -is also used throughout the README (to get help-text and version numbers), which -means that when running `cargo test`, the README gets automatically updated. +> is that the test loads the README itself, and runs `present` over it. +> `present` is also used throughout the README (to get help-text and version +> numbers), which means that when running `cargo test`, the README gets +> automatically updated. You can read more about using the library on [docs.rs](https://docs.rs/present). @@ -102,22 +103,24 @@ Below are a few examples showcasing what kind of command result interpolations - ````ignore - foo +````ignore +foo + +```present echo bar +``` +```` - ```present echo bar - ``` - ```` - ````ignore - foo +````ignore +foo + +```present echo bar +bar +``` +```` - ```present echo bar - bar - ``` - ```` @@ -125,20 +128,22 @@ Below are a few examples showcasing what kind of command result interpolations - ````ignore - foo +````ignore +foo + +```present echo bar +``` +```` - ```present echo bar - ``` - ```` - ````ignore - foo +```ignore +foo + +bar +``` - bar - ````