This repository has been archived by the owner on Oct 31, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 57
/
Makefile
74 lines (52 loc) · 2.16 KB
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
.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
##@ Helpers
help: ## Display this 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: ## Clean all tests
@$(CARGO) clean
wash drain all
deps-check:
@$(PYTHON) tools/deps_check.py
run-ui: # Run UI from source
@$(NPM) install --prefix washboard
@$(NPM) run --prefix washboard dev
##@ Building
build: ## Build the project
@$(CARGO) build
build-watch: ## Continuously build the project
@$(CARGO) watch -x build
build-ui: ## Build the UI from source
@$(NPM) install --prefix .washboard
@$(NPM) run build --prefix .washboard
##@ Testing
test: ## Run unit test suite
@$(CARGO) nextest run $(TARGET) --no-fail-fast --bin wash
@$(CARGO) nextest run $(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: ## Run unit tests continously, can optionally specify a target test filter.
@$(CARGO) watch -- $(CARGO) nextest run $(TARGET)
test-integration: ## Run the entire integration test suite (with docker compose)
@$(DOCKER) compose -f ./tools/docker-compose.yml up --detach
@$(CARGO) nextest run $(TARGET) --profile integration -E 'kind(test)' --nocapture
@$(DOCKER) compose -f ./tools/docker-compose.yml down
test-integration-ci: ## Run the entire integration test suite only
@$(CARGO) nextest run --profile ci -E 'kind(test)'
test-integration-watch: ## Run integration test suite continuously
@$(CARGO) watch -- $(MAKE) test-integration
test-unit: ## Run one or more unit tests
@$(CARGO) nextest run $(TARGET)
test-unit-watch: ## Run tests continuously
@$(CARGO) watch -- $(MAKE) test-unit
rust-check: ## Run rust checks
@$(CARGO) fmt --all --check
@$(CARGO) clippy --all-features --all-targets --workspace
test-all: ## Run all tests
$(MAKE) test
$(MAKE) test-integration
$(MAKE) rust-check