github.com/speedoops/go-gqlrest-demo@v0.0.0-20220710122636-5c6460aeab4f/Makefile (about)

     1  .PHONY: all gen build run test lint
     2  
     3  all: gen build test lint
     4  
     5  gen:
     6  	@# https://github.com/golang/go/issues/44129 // add "-mod=mod" as workaround for go 1.16 bug
     7  	go run -mod=mod github.com/speedoops/go-gqlrest
     8  
     9  build:
    10  	go build
    11  
    12  release:
    13  	go build -o go-gqlrest-federation.exe main.go
    14  	
    15  run:	
    16  	# @command -v air &>/dev/null || go install github.com/cosmtrek/air
    17  	# air
    18  	go run main.go
    19  
    20  test:
    21  	#go test -timeout 30s -run ^TestTodo ./... -v -failfast -coverpkg=github.com/speedoops/go-gqlrest/... -coverprofile=coverage.out
    22  	go test -timeout 30s -run ^TestTodo ./... -v -failfast -coverpkg=./...,github.com/speedoops/go-gqlrest/... -coverprofile=coverage.out
    23  	go tool cover -func=coverage.out | tail -n 1 | awk '{print "Total coverage: " $$3 " of statements"}'
    24  	go tool cover -html=coverage.out -o coverage.html
    25  
    26  smoke:
    27  	go test -gcflags=all=-l -timeout 30s ./... -short -v -coverprofile=coverage.out
    28  	go tool cover -func=coverage.out | tail -n 1 | awk '{print "Total coverage: " $$3 " of statements"}'
    29  
    30  lint:
    31  	golangci-lint run --timeout=5m