.DEFAULT_GOAL := help
.PHONY: dev build lint fix check tests tests-ci develop test format checks help
dev:
rustup component add rustfmt
rustup component add clippy
cargo install cargo2junit
cargo install grcov
cargo install -f wasm-bindgen-cli
rustup target add wasm32-unknown-unknown
rustup component add llvm-tools-preview
build:
cargo build --release --all-features
lint:
cargo clippy --all-features
cargo fmt --all -- --check
fix:
cargo fmt --all
check:
cargo check --all-features
tests:
cargo test -- --show-output
tests-ci: $(eval SHELL:=/bin/bash)
{ \
export CARGO_INCREMENTAL=0;\
export RUSTDOCFLAGS="-Cpanic=abort";\
export RUSTFLAGS="-Zprofile -Ccodegen-units=1 -Copt-level=0 -Clink-dead-code -Coverflow-checks=off -Zpanic_abort_tests -Cpanic=abort";\
cargo test -- -Z unstable-options --format json | cargo2junit > junit.xml;\
grcov . --llvm -s . -t cobertura --branch --ignore-not-existing -o ./coverage.xml;\
}
develop: dev
test: tests
format: fix
checks: check
help:
@grep -E '^[a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) | sort | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-30s\033[0m %s\n", $$1, $$2}'
print-%:
@echo '$*=$($*)'