From 50ff68550cfec9340c77b99620874139dae27c2e Mon Sep 17 00:00:00 2001 From: pool2win Date: Fri, 19 Jan 2024 10:53:52 +0100 Subject: [PATCH 1/2] Add github action for llvm-cov coverage The action reports the generated report to coveralls. --- .github/workflows/coveralls.yml | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 .github/workflows/coveralls.yml diff --git a/.github/workflows/coveralls.yml b/.github/workflows/coveralls.yml new file mode 100644 index 00000000..e0a60d5f --- /dev/null +++ b/.github/workflows/coveralls.yml @@ -0,0 +1,24 @@ +on: + - push + - pull_request + +name: Code coverage with llvm-cov + +jobs: + Coveralls: + name: Code coverage - stable toolchain + runs-on: ubuntu-latest + strategy: + fail-fast: false + steps: + - name: Checkout Crate + uses: actions/checkout@v4 + - name: Checkout Toolchain + # https://github.com/dtolnay/rust-toolchain + uses: dtolnay/rust-toolchain@stable + - name: Install cargo-llvm-cov + uses: taiki-e/install-action@cargo-llvm-cov + - name: Generate code coverage for tests + run: cargo llvm-cov --all-features --workspace --lcov --output-path lcov.info + - name: Upload report to coveralls + uses: coverallsapp/github-action@v2 From 47b476ec5bdc2f4d9a9fd28f30a7152e1bf45277 Mon Sep 17 00:00:00 2001 From: pool2win Date: Fri, 19 Jan 2024 18:09:59 +0100 Subject: [PATCH 2/2] Ignore fuzz dir from coverage reports --- .github/workflows/coveralls.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/coveralls.yml b/.github/workflows/coveralls.yml index e0a60d5f..a3d37cd3 100644 --- a/.github/workflows/coveralls.yml +++ b/.github/workflows/coveralls.yml @@ -19,6 +19,6 @@ jobs: - name: Install cargo-llvm-cov uses: taiki-e/install-action@cargo-llvm-cov - name: Generate code coverage for tests - run: cargo llvm-cov --all-features --workspace --lcov --output-path lcov.info + run: cargo llvm-cov --ignore-filename-regex fuzz --all-features --workspace --lcov --output-path lcov.info - name: Upload report to coveralls uses: coverallsapp/github-action@v2