From 862b3263fb1594ff39dbc86b469c14e385737702 Mon Sep 17 00:00:00 2001 From: louib Date: Fri, 16 Aug 2024 00:22:03 -0400 Subject: [PATCH] ci: configure code coverage --- .github/workflows/ci.yml | 15 +++++++++++++++ .tarpaulin.toml | 7 +++++++ 2 files changed, 22 insertions(+) create mode 100644 .tarpaulin.toml diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 9e3efab..be89a2a 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -73,3 +73,18 @@ jobs: toolchain: stable - name: run cargo test run: cargo test --all-features + + coverage: + name: Code Coverage + runs-on: ubuntu-latest + container: + image: docker.io/xd009642/tarpaulin:0.31.0 + options: --security-opt seccomp=unconfined + steps: + - uses: actions/checkout@v4 + - name: Generate code coverage + run: | + cargo tarpaulin --verbose --timeout 120 + ls -la + + # TODO add a step to upload the html coverage report diff --git a/.tarpaulin.toml b/.tarpaulin.toml new file mode 100644 index 0000000..c5f769a --- /dev/null +++ b/.tarpaulin.toml @@ -0,0 +1,7 @@ +[all] +all-features = true +workspace = true +target-dir = "target/coverage/" +fail-under = 80 +exclude-files = ["target/*"] +out = ["Xml", "Html"]