-
Notifications
You must be signed in to change notification settings - Fork 38
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix code coverage to include coverage from doctests
This replaces tarpaulin with llvm-cov which seems to be much faster, works across platforms, and should be more reliable moving forward since it uses rustc native coverage information. Use of nightly compiler is required due to unstable features <rust-lang/rust#84605> and <rust-lang/rust#56925>.
- Loading branch information
Showing
10 changed files
with
56 additions
and
38 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -88,27 +88,43 @@ jobs: | |
coverage: | ||
name: Code coverage | ||
runs-on: ubuntu-latest | ||
env: | ||
RUST_BACKTRACE: 1 | ||
steps: | ||
- name: Check out code | ||
uses: actions/checkout@v2 | ||
- name: Install Rust toolchain | ||
uses: actions-rs/toolchain@v1 | ||
with: | ||
profile: minimal | ||
toolchain: stable | ||
toolchain: nightly | ||
override: true | ||
- name: Run tarpaulin | ||
uses: actions-rs/[email protected] | ||
components: llvm-tools-preview | ||
- name: Install llvm-cov | ||
uses: taiki-e/install-action@v1 | ||
with: | ||
args: > | ||
--workspace --manifest-path binrw/Cargo.toml | ||
--exclude-files binrw/tests | ||
tool: cargo-llvm-cov | ||
- name: Generate coverage data | ||
run: > | ||
cargo llvm-cov --doctests | ||
--ignore-filename-regex 'binrw/tests' | ||
--no-report | ||
&& | ||
cargo llvm-cov --all-features | ||
--ignore-filename-regex 'binrw/tests' | ||
--no-report | ||
- name: Show coverage results | ||
run: cargo llvm-cov --doctests --no-run | ||
# https://github.com/actions/runner/issues/520 | ||
- name: Determine whether codecov.io secret is available | ||
id: has_codecov | ||
run: echo '::set-output name=result::${{ secrets.CODECOV_TOKEN }}' | ||
- name: Generate coverage file | ||
run: cargo llvm-cov --doctests --no-run --lcov --output-path lcov.info | ||
if: steps.has_codecov.outputs.result != 0 | ||
- name: Upload to codecov.io | ||
uses: codecov/codecov-action@v1 | ||
with: | ||
files: lcov.info | ||
token: ${{ secrets.CODECOV_TOKEN }} | ||
if: steps.has_codecov.outputs.result != 0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters