[tasks.clean-all] script = """ cargo clean rm -rf profraw """ [tasks.create-profraw-dir] command = "mkdir" args = ["-p", "./profraw"] [tasks.install-stable] ignore_errors = true command = "rustup" args = ["toolchain", "install", "stable", "--component", "llvm-tools-preview"] [tasks.build-stable] install_crate = false dependencies = ["install-stable"] command = "cargo" args = ["+stable", "build", "--target", "x86_64-unknown-linux-musl"] [tasks.build-stable.env] RUSTFLAGS="-Cinstrument-coverage" LLVM_PROFILE_FILE="profraw/hoard-python-test-%p-%m.profraw" [tasks.deny] command = "cargo" args = ["deny", "check"] [tasks.test-nextest] dependencies = ["clean-all", "install-stable", "create-profraw-dir"] command = "cargo" args = ["nextest", "run"] [tasks.test-nextest.env] RUSTFLAGS="-Cinstrument-coverage -Copt-level=0 -Ccodegen-units=1" LLVM_PROFILE_FILE="profraw/hoard-cargo-test-%p-%m.profraw" [tasks.test-single-thread] install_crate = false dependencies = ["clean-all", "install-stable", "create-profraw-dir"] command = "cargo" args = ["+stable", "test", "--", "--test-threads=1"] [tasks.test-single-thread.env] RUSTFLAGS="-Cinstrument-coverage -Copt-level=0 -Ccodegen-units=1" LLVM_PROFILE_FILE="profraw/hoard-cargo-test-%p-%m.profraw" [tasks.docker-tests] dependencies = ["clean-all", "create-profraw-dir"] script = """ sudo docker image build . -t hoard-tests --no-cache echo "Running tests" sudo docker container run --rm -v $(pwd)/profraw:/hoard-tests/profraw:Z hoard-tests echo "Ran tests" """ [tasks.test-all] # Do docker tests first so ./target is not sent to Docker dependencies = ["docker-tests", "test-nextest"] [tasks.grcov] install_crate = { crate_name = "grcov" } dependencies = ["clean-all", "test-all"] # Using `script` is necessary to get the glob expansion script = """ grcov profraw/*.profraw --binary-path ./target/debug \ -s . -t html --branch --ignore-not-existing -o ./target/debug/coverage --ignore src/main.rs \ --excl-br-line "($EXCLUDE_DERIVE|$EXCLUDE_PANICS|$EXCLUDE_TRACING|$EXCLUDE_PROPAGATE_ERROR|$EXCLUDE_MANUAL|$EXCLUDE_LONE_CLOSING_BRACE)" \ --excl-line "($EXCLUDE_DERIVE|$EXCLUDE_PANICS|$EXCLUDE_TRACING|$EXCLUDE_PROPAGATE_ERROR|$EXCLUDE_MANUAL|$EXCLUDE_LONE_CLOSING_BRACE)" \ --excl-br-start "(grcov: ignore-start|mod tests)" --excl-start "(grcov: ignore-start|mod tests)" \ --excl-br-stop "grcov: ignore-end" --excl-stop "grcov: ignore-end" """ [tasks.grcov.env] RUSTFLAGS="-Cinstrument-coverage" RUSTUP_TOOLCHAIN="stable" HOARD_LOG="trace" EXCLUDE_DERIVE="#\\[derive\\(" EXCLUDE_PANICS="panic!|todo!|unimplemented!|unreachable!" EXCLUDE_TRACING="kjhgfdsadgjkl" #tracing::(error|warn|info|debug|trace)(_span)?!" EXCLUDE_PROPAGATE_ERROR="(return|(Err\\(err(or)?\\)|err(or)?) =>) (Some\\()?Err\\(err(or)?(\\.into\\(\\))?\\)" EXCLUDE_MANUAL="grcov: ignore" EXCLUDE_LONE_CLOSING_BRACE="^\\s*\\}\\s*$" [tasks.view-grcov] dependencies = ["clean-all", "grcov"] command = "xdg-open" args = ["./target/debug/coverage/index.html"] [tasks.book] command = "mdbook" args = ["serve", "./book"] [tasks.outdated] command = "cargo" args = ["outdated", "-R"] [tasks.deadlinks] command = "cargo" args = ["deadlinks"] [tasks.check-all] dependencies = ["clippy", "check-format", "docs", "test-nextest", "deadlinks", "deny", "msrv-verify"] [tasks.changelog] command = "git-cliff" args = ["-o", "CHANGELOG.md"] [tasks.msrv] command = "cargo" args = ["msrv"] [tasks.msrv-verify] command = "cargo" args = ["msrv", "verify"]