From 20f61867cee8faab35d5cb786df133accbdc2054 Mon Sep 17 00:00:00 2001 From: danieleades <33452915+danieleades@users.noreply.github.com> Date: Wed, 29 Nov 2023 14:10:27 +0000 Subject: [PATCH] add test coverage workflow (#460) --- .github/workflows/coverage.yml | 40 ++++++++++++++++++++++++++++++++++ 1 file changed, 40 insertions(+) create mode 100644 .github/workflows/coverage.yml diff --git a/.github/workflows/coverage.yml b/.github/workflows/coverage.yml new file mode 100644 index 000000000..4af78404a --- /dev/null +++ b/.github/workflows/coverage.yml @@ -0,0 +1,40 @@ +on: + push: + branches: [master] + pull_request: + +name: Code Coverage + +jobs: + coverage: + name: coverage + runs-on: ubuntu-latest + steps: + - name: checkout source + uses: actions/checkout@v4 + + - name: Install Cap'n Proto + run: | + export DEBIAN_FRONTEND=noninteractive + sudo apt-get install -y capnproto libcapnp-dev + + - uses: dtolnay/rust-toolchain@nightly + + - name: Install cargo-llvm-cov + uses: taiki-e/install-action@cargo-llvm-cov + + - name: Run llvm-cov + run: | + for features in \ + "--no-default-features" \ + "--features sync_reader" \ + "--features unaligned" + do + cargo llvm-cov --no-report --doctests --workspace $features + done + cargo llvm-cov report --lcov --output-path lcov.info + + - name: Upload coverage to Codecov + uses: codecov/codecov-action@v3 + with: + files: lcov.info