This repository was archived by the owner on Aug 14, 2025. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
45 lines (35 loc) · 1.44 KB
/
Makefile
File metadata and controls
45 lines (35 loc) · 1.44 KB
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
########################
### Makefile Helpers ###
########################
.PHONY: list
list: ## List all make targets
@${MAKE} -pRrn : -f $(MAKEFILE_LIST) 2>/dev/null | awk -v RS= -F: '/^# File/,/^# Finished Make data base/ {if ($$1 !~ "^[#.]") {print $$1}}' | egrep -v -e '^[^[:alnum:]]' -e '^$@$$' | sort
.PHONY: help
.DEFAULT_GOAL := help
help: ## Prints all the targets in all the Makefiles
@grep -h -E '^[a-zA-Z0-9_-]+:.*?## .*$$' $(MAKEFILE_LIST) | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-60s\033[0m %s\n", $$1, $$2}'
####################
### Test Targets ###
####################
.PHONY: test_all
test_all: ## Runs all tests
go test ./... -count=1
.PHONY: test_all_verbose
test_all_verbose: ## Runs all tests with verbose output enabled
go test -v ./... -count=1
.PHONY: test_unit
test_unit: ## Runs unit tests only (excludes Postgres Docker integration tests)
go test ./... -short -count=1
####################
### Mock Targets ###
####################
# TODO_IMPROVE(@commoddity): Update to use go:generate pattern for generating mocks from interfaces
.PHONY: gen_mocks
gen_mocks: ## Generates mocks for testing
mockgen -source=./grpc/data_source.go -destination=./grpc/data_source_mock_test.go -package=grpc
#############################
### SQL Generator Targets ###
#############################
.PHONY: grove_gen_sqlc
grove_gen_sqlc: ## Generates the SQLC code for Grove's portal schema
sqlc generate -f ./postgres/grove/sqlc/sqlc.yaml