Skip to content

Commit

Permalink
fix: include doctests in test coverage calculations (#397)
Browse files Browse the repository at this point in the history
* 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: actions-rs/tarpaulin#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:
actions-rs/tarpaulin#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: xd009642/tarpaulin#538
  • Loading branch information
dlaehnemann authored Jun 20, 2023
1 parent 8beee14 commit 8ed0837
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions .github/workflows/rust.yml
Original file line number Diff line number Diff line change
Expand Up @@ -52,10 +52,10 @@ jobs:
with:
submodules: recursive

- name: Install stable toolchain
- name: Install nightly toolchain
uses: actions-rs/[email protected]
with:
toolchain: stable
toolchain: nightly
override: true

- name: Install system dependencies
Expand All @@ -67,8 +67,9 @@ jobs:
- name: Run cargo-tarpaulin
uses: actions-rs/[email protected]
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
Expand Down

0 comments on commit 8ed0837

Please sign in to comment.