From 8ed083783fa1dce09535564a090d37f687fc832f Mon Sep 17 00:00:00 2001 From: David Laehnemann Date: Tue, 20 Jun 2023 20:04:26 +0200 Subject: [PATCH] fix: include doctests in test coverage calculations (#397) * update tarpaulin used in CI to latest available version * fix: try including `--doc --examples` in tarpaulin arguments, to include coverage by doctests and code examples * revert back to 0.22.0 until tarpaulin action is fixed: https://github.com/actions-rs/tarpaulin/pull/23 It seems like the download is broken in the `actions-rs/tarpaulin` GitHub Action for all tarpaulin versions above `0.22.0`. See this pending fix for details: https://github.com/actions-rs/tarpaulin/pull/23 * try with the nightly toolchain for code coverage of doctests * document in-code the current problem with artefact download blocking tarpaulin update * try with `--run-types Tests,Doctests` for full coverage: https://github.com/xd009642/tarpaulin/issues/538 --- .github/workflows/rust.yml | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/.github/workflows/rust.yml b/.github/workflows/rust.yml index 4a11c5268..6ac254080 100644 --- a/.github/workflows/rust.yml +++ b/.github/workflows/rust.yml @@ -52,10 +52,10 @@ jobs: with: submodules: recursive - - name: Install stable toolchain + - name: Install nightly toolchain uses: actions-rs/toolchain@v1.0.6 with: - toolchain: stable + toolchain: nightly override: true - name: Install system dependencies @@ -67,8 +67,9 @@ jobs: - name: Run cargo-tarpaulin uses: actions-rs/tarpaulin@v0.1 with: + # TODO: update to latest tarpaulin once artefact download is fixed: https://github.com/actions-rs/tarpaulin/pull/23 version: "0.22.0" - args: "--all-features --out Lcov -- --test-threads 1" + args: "--all-features --run-types Tests,Doctests --out Lcov -- --test-threads 1" - name: Upload coverage uses: coverallsapp/github-action@v1