Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: use llvm-cov for coverage #478

Merged
merged 17 commits into from
Dec 7, 2022
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .cargo/config
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@ gen-syntax = "run --package tools --bin tools -- gen-syntax"
gen-runtime-capi = "run --package tools --bin tools -- gen-runtime-capi"
gen-abi = "run --package tools --bin tools -- gen-abi"

[profile.min-artifact-size-debug]
[profile.llvm-cov-target]
inherits = "dev"

# disable debug symbols for all packages except this one
[profile.min-artifact-size-debug.package."*"]
[profile.llvm-cov-target.package."*"]
debug = false
49 changes: 13 additions & 36 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ jobs:
with:
profile: minimal
override: true
components: rustfmt
components: rustfmt, llvm-tools-preview

- uses: Swatinem/rust-cache@v1
if: matrix.os != 'windows-latest'
Expand All @@ -93,6 +93,9 @@ jobs:
command: test
args: --doc --all-features --profile min-artifact-size-debug

- name: Install latest llvm-cov release
uses: taiki-e/install-action@cargo-llvm-cov

- name: Install latest nextest release
uses: taiki-e/install-action@nextest

Expand All @@ -105,8 +108,15 @@ jobs:
RUSTFLAGS: ${{ matrix.RUSTFLAGS }}
CARGO_INCREMENTAL: ${{ matrix.CARGO_INCREMENTAL }}
with:
command: nextest
args: run --all-features --profile ci --cargo-profile min-artifact-size-debug
command: llvm-cov
args: --all-features --workspace --lcov --output-path lcov.info --profile ci

- name: Upload coverage to Codecov
uses: codecov/codecov-action@v3
with:
files: lcov.info
name: ${{ matrix.os }}
fail_ci_if_error: true

test-mdbook:
name: Test mdbook
Expand Down Expand Up @@ -249,36 +259,3 @@ jobs:
with:
token: ${{ secrets.GITHUB_TOKEN }}
args: --all-features

tarpaulin:
runs-on: ubuntu-latest
needs: check
steps:
- uses: actions/checkout@v3
with:
submodules: true

- name: Install packages
run: |
sudo apt-get update
sudo apt-get install libasound2-dev libudev-dev

- name: Install toolchain
uses: actions-rs/toolchain@v1
with:
profile: minimal
override: true
components: rustfmt

- uses: Swatinem/rust-cache@v1

- name: Install LLVM
uses: ./.github/actions/install-llvm

- name: Run cargo-tarpaulin
uses: actions-rs/[email protected]

- uses: codecov/codecov-action@v3
with:
file: ${{ steps.coverage.outputs.report }}
name: ${{ matrix.os }}
Loading