From 6721b9672a287823fba09e1e8240fd3bfb8a4578 Mon Sep 17 00:00:00 2001 From: realaravinth Date: Fri, 29 Oct 2021 20:24:20 +0530 Subject: [PATCH] setup make --- Makefile | 40 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 40 insertions(+) create mode 100644 Makefile diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..ea40ce8 --- /dev/null +++ b/Makefile @@ -0,0 +1,40 @@ +default: ## Debug build + cargo build + +clean: ## Clean all build artifacts and dependencies + @cargo clean + +coverage: ## Generate HTML code coverage + cargo tarpaulin -t 1200 --out Html + +dev-env: ## Download development dependencies + cargo fetch + +doc: ## Prepare documentation + cargo doc --no-deps --workspace --all-features + +docker: ## Build docker images + docker build -t realaravinth/pages:master -t realaravinth/pages:latest . + +docker-publish: docker ## Build and publish docker images + docker push realaravinth/pages:master + docker push realaravinth/pages:latest + +lint: ## Lint codebase + cargo fmt -v --all -- --emit files + cargo clippy --workspace --tests --all-features + +release: ## Release build + cargo build --release + +run: default ## Run debug build + cargo run + +test: ## Run tests + cargo test --all-features --no-fail-fast + +xml-test-coverage: ## Generate cobertura.xml test coverage + cargo tarpaulin -t 1200 --out Xml + +help: ## Prints help for targets with comments + @cat $(MAKEFILE_LIST) | grep -E '^[a-zA-Z_-]+:.*?## .*$$' | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-30s\033[0m %s\n", $$1, $$2}'