Skip to content

Commit

Permalink
Merge pull request #120 from okp4/ci/fix-test
Browse files Browse the repository at this point in the history
Fix test workflow
  • Loading branch information
ad2ien committed Nov 17, 2022
2 parents 29ba7cb + 118d3be commit 5a6cc4b
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
3 changes: 3 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,9 @@ jobs:
- name: Install grcov
run: if [[ ! -e ~/.cargo/bin/grcov ]]; then cargo install grcov; fi

- name: Install llvm-tools
run: rustup component add llvm-tools-preview

- name: Install cargo make
uses: davidB/rust-cargo-make@v1

Expand Down
5 changes: 2 additions & 3 deletions Makefile.toml
Original file line number Diff line number Diff line change
Expand Up @@ -70,12 +70,11 @@ args = ["test", "--tests", "--workspace", "--locked", "--all-features"]
command = "cargo"
dependencies = ["build-coverage"]
description = "Run all unit tests."
env = { LLVM_PROFILE_FILE = "default.profraw", RUST_BACKTRACE = 1 }
install_crate = { rustup_component_name = "llvm-tools-preview" }
env = { LLVM_PROFILE_FILE = "default_%p.profraw", RUST_BACKTRACE = 1, RUSTFLAGS = "-Cinstrument-coverage" }

[tasks.test-coverage]
dependencies = ["test"]
install_crate = { crate_name = "grcov" }
install_crate = { crate_name = "grcov", rustup_component_name = "llvm-tools-preview", binary = "grcov", test_arg = "--help" }
script = '''
grcov . --binary-path ./target/debug/ -s . -t lcov --branch --ignore-not-existing --ignore "*cargo*" -o coverage.lcov
'''
Expand Down

0 comments on commit 5a6cc4b

Please sign in to comment.