mirror of
https://github.com/lightninglabs/faraday.git
synced 2026-08-13 12:33:35 +02:00
makefile+travis: add mod check
Add a check to travis that will tidy modules and fail if the tidy results in changes to go.mod or go.sum.
This commit is contained in:
parent
2ca93a2ebe
commit
02ab94db2c
2 changed files with 11 additions and 0 deletions
|
|
@ -21,6 +21,7 @@ before_script:
|
|||
script:
|
||||
- export GO111MODULE=on
|
||||
- make rpc-check
|
||||
- make mod-check
|
||||
- make lint unit
|
||||
|
||||
after_script:
|
||||
|
|
|
|||
10
Makefile
10
Makefile
|
|
@ -20,6 +20,7 @@ DEPGET := cd /tmp && GO111MODULE=on go get -v
|
|||
GOBUILD := GO111MODULE=on go build -v
|
||||
GOINSTALL := GO111MODULE=on go install -v
|
||||
GOTEST := GO111MODULE=on go test -v
|
||||
GOMOD := GO111MODULE=on go mod
|
||||
|
||||
GOFILES_NOVENDOR = $(shell find . -type f -name '*.go' -not -path "./vendor/*")
|
||||
GOLIST := go list -deps $(PKG)/... | grep '$(PKG)'| grep -v '/vendor/'
|
||||
|
|
@ -117,6 +118,15 @@ lint: $(LINT_BIN)
|
|||
@$(call print, "Linting source.")
|
||||
$(LINT)
|
||||
|
||||
mod:
|
||||
@$(call print, "Tidying modules.")
|
||||
$(GOMOD) tidy
|
||||
|
||||
mod-check:
|
||||
@$(call print, "Checking modules.")
|
||||
$(GOMOD) tidy
|
||||
if test -n "$$(git status | grep -e "go.mod\|go.sum")"; then echo "Running go mod tidy changes go.mod/go.sum"; git status; git diff; exit 1; fi
|
||||
|
||||
rpc:
|
||||
@$(call print, "Compiling protos.")
|
||||
cd ./frdrpc; ./gen_protos.sh
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue