-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
42 lines (33 loc) · 1.17 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
default: help
.PHONY: help
help: ## Print this help message
@echo "Available make commands:"; grep -h -E '^[a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) | sort | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-30s\033[0m %s\n", $$1, $$2}'
.envrc: ## Setup .envrc
ln -s .envrc.example .envrc
.PHONY: tools
tools: ## Install dev tools
cargo install --version="~0.6" sqlx-cli --no-default-features --features rustls,postgres
.PHONY: postgres
postgres: ## Start a postgres container with high connections for testing purposes
docker run \
-e POSTGRES_USER=postgres \
-e POSTGRES_PASSWORD=postgres \
-e POSTGRES_DB=chain_registry \
-p 5432:5432 \
-d postgres \
postgres -N 1000
.PHONY: psql
psql: ## Connect to the test postgres container
psql -h localhost -U postgres -d chain_registry
.PHONY: prepare
prepare: ## Prepare sqlx offline data
cargo sqlx prepare -- --tests
.PHONY: test
test: prepare ## Run unit and quick integration tests
cargo test
.PHONY: test-all
test-all: prepare ## Run all tests including longer integration tests
cargo test -- --include-ignored
.PHONY: watch
watch: prepare ## Watch for changes and run cargo
cargo watch -x check