github.com/zaquestion/lab@v0.25.1/Makefile (about)

     1  VERSION ?= $(shell git describe --long --tags)
     2  GOURL ?= github.com/zaquestion/lab
     3  
     4  build:
     5  	GO111MODULE=on go build -ldflags "-X 'main.version=$(VERSION)'" $(GOURL)
     6  
     7  install: build
     8  	GO111MODULE=on go install -ldflags "-X 'main.version=$(VERSION)'" $(GOURL)
     9  
    10  test:
    11  	bash -c "trap 'trap - SIGINT SIGTERM ERR; mv testdata/.git testdata/test.git; rm coverage-* 2>&1 > /dev/null; exit 1' SIGINT SIGTERM ERR; $(MAKE) internal-test"
    12  
    13  internal-test:
    14  	rm -f coverage-*
    15  	GO111MODULE=on go test -coverprofile=coverage-main.out -covermode=count -coverpkg ./... -run=$(run) $(GOURL)/cmd $(GOURL)/internal/...
    16  	go get -u github.com/wadey/gocovmerge
    17  	gocovmerge coverage-*.out > coverage.txt && rm coverage-*.out
    18  
    19  .PHONY: build install test internal-test