code.vegaprotocol.io/vega@v0.79.0/Makefile (about) 1 # Makefile 2 3 .PHONY: all 4 all: build 5 6 .PHONY: lint 7 lint: ## Lint the files 8 go run github.com/golangci/golangci-lint/cmd/golangci-lint@v1.55.2 run -v --config .golangci.toml 9 10 .PHONY: retest 11 retest: ## Re-run all unit tests 12 go test -v -count=1 ./... 13 14 .PHONY: test 15 test: ## Run unit tests 16 go test -v -failfast ./... 17 18 .PHONY: integrationtest 19 integrationtest: ## run integration tests, showing ledger movements and full scenario output 20 go test -v ./core/integration/... --godog.format=pretty 21 22 .PHONY: gqlgen 23 gqlgen: 24 cd datanode/gateway/graphql && go run github.com/99designs/gqlgen@v0.17.45 --config=gqlgen.yml 25 26 .PHONY: race 27 race: ## Run data race detector 28 go test -v -race ./... 29 30 .PHONY: mocks 31 mocks: ## Make mocks 32 go generate -v ./... 33 34 .PHONY: mocks_check 35 mocks_check: ## mocks: Check committed files match just-generated files 36 # TODO: how to delete all generated files 37 # @make proto_clean 1>/dev/null 38 @make mocks 1>/dev/null 39 @files="$$(git diff --name-only)" ; \ 40 if test -n "$$files" ; then \ 41 echo "Committed files do not match just-generated files: " $$files ; \ 42 git diff ; \ 43 exit 1 ; \ 44 fi 45 46 .PHONY: build 47 build: ## install the binaries in cmd/{progname}/ 48 go build -o cmd/vega ./cmd/vega 49 50 51 .PHONY: gen-contracts-code 52 gen-contracts-code: 53 cd contracts && ./gen.sh 54 .PHONY: install 55 install: ## install the binaries in GOPATH/bin 56 go install ./... 57 58 codeowners_check: 59 @if grep -v '^#' CODEOWNERS | grep "," ; then \ 60 echo "CODEOWNERS cannot have entries with commas" ; \ 61 exit 1 ; \ 62 fi 63 64 # Make sure the mdspell command matches the one in .drone.yml. 65 .PHONY: spellcheck 66 spellcheck: ## Run markdown spellcheck container 67 @docker run --rm -ti \ 68 --entrypoint mdspell \ 69 -v "$(PWD):/src" \ 70 pipelinecomponents/markdown-spellcheck \ 71 --en-gb \ 72 --ignore-acronyms \ 73 --ignore-numbers \ 74 --no-suggestions \ 75 --report \ 76 '*.md' \ 77 'docs/**/*.md' 78 79 80 .PHONY: clean 81 clean: SHELL:=/bin/bash 82 clean: ## Remove previous build 83 rm cmd/vega/vega 84 rm -rf ./**/*-re 85 86 .PHONY: proto 87 proto: ## build proto definitions 88 buf generate 89 90 .PHONY: proto_docs 91 proto_docs: ## build proto definitions 92 rm -rf protos/generated 93 buf generate --template buf.gen.swagger.yaml 94 95 .PHONY: proto_check 96 proto_check: ## proto: Check committed files match just-generated files 97 @make proto_clean 1>/dev/null 98 @make proto 1>/dev/null 99 @files="$$(git diff --name-only protos/vega/ protos/data-node/)" ; \ 100 if test -n "$$files" ; then \ 101 echo "Committed files do not match just-generated files: " $$files ; \ 102 git diff ; \ 103 exit 1 ; \ 104 fi 105 106 .PHONY: proto_format_check 107 proto_format_check: 108 @make proto_clean 1>/dev/null 109 @make proto 1>/dev/null 110 buf format --exit-code --diff 111 112 .PHONY: proto_clean 113 proto_clean: 114 @find protos/vega protos/data-node -name '*.pb.go' -o -name '*.pb.gw.go' \ 115 | xargs -r rm 116 117 .PHONY: buflint 118 buflint: ## Run buf lint 119 @buf lint