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 62a044e..a18450b 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,7 @@ ## vim-profiler 🕒 [![CI](https://github.com/terror/vim-profiler/actions/workflows/ci.yaml/badge.svg?branch=master)](https://github.com/terror/zk/actions/workflows/ci.yaml) +[![codecov](https://codecov.io/github/terror/vim-profiler/graph/badge.svg?token=5BJLERWSY1)](https://codecov.io/github/terror/vim-profiler) [![crates.io](https://shields.io/crates/v/vim-profiler.svg)](https://crates.io/crates/vim-profiler) [![dependency status](https://deps.rs/repo/github/terror/vim-profiler/status.svg)](https://deps.rs/repo/github/terror/vim-profiler)