.DEFAULT_GOAL:=help
.PHONY: build build-watch build-ui test test-integration test-all clean help run-ui
CARGO ?= cargo
DOCKER ?= docker
PYTHON ?= python3
NPM ?= npm
help:
@awk 'BEGIN {FS = ":.*##"; printf "\nUsage:\n make \033[36m<target>\033[0m\n"} /^[a-zA-Z_\-.*]+:.*?##/ { printf " \033[36m%-15s\033[0m %s\n", $$1, $$2 } /^##@/ { printf "\n\033[1m%s\033[0m\n", substr($$0, 5) } ' $(MAKEFILE_LIST)
clean:
@$(CARGO) clean
wash drain all
deps-check:
@$(PYTHON) tools/deps_check.py
run-ui:
@$(NPM) install --prefix washboard
@$(NPM) run --prefix washboard dev
build:
@$(CARGO) build
build-watch:
@$(CARGO) watch -x build
build-ui:
@$(NPM) install --prefix .washboard
@$(NPM) run build --prefix .washboard
test:
@$(CARGO) nextest run $(CARGO_TEST_TARGET) --no-fail-fast --bin wash
@$(CARGO) nextest run $(CARGO_TEST_TARGET) --no-fail-fast -p wash-lib --features=cli
test-wash-ci:
@$(CARGO) nextest run --profile ci --workspace --all-features -E 'binary(wash)' -E 'package(wash-lib)'
test-watch:
@$(CARGO) watch -- $(CARGO) nextest run $(TARGET)
test-integration:
@$(DOCKER) compose -f ./tools/docker-compose.yml up --detach
@$(CARGO) nextest run --profile integration -E 'kind(test)'
@$(DOCKER) compose -f ./tools/docker-compose.yml down
test-integration-ci:
@$(CARGO) nextest run --profile ci -E 'kind(test)'
test-integration-watch:
@$(CARGO) watch -- $(MAKE) test-integration
test-unit:
@$(CARGO) nextest run $(CARGO_TEST_TARGET)
test-unit-watch:
@$(CARGO) watch -- $(MAKE) test-unit
rust-check:
@$(CARGO) fmt --all --check
@$(CARGO) clippy --all-features --all-targets --workspace
test-all:
$(MAKE) test
$(MAKE) test-integration
$(MAKE) rust-check