undocker/Makefile

35 lines
582 B
Makefile
Raw Normal View History

2021-06-01 05:49:39 +00:00
GODEPS = $(shell git ls-files '*.go' go.mod go.sum)
2021-06-01 06:07:32 +00:00
GOBIN = $(shell go env GOPATH)/bin/
2021-06-01 05:49:39 +00:00
2021-06-01 16:54:55 +00:00
.PHONY: all
all: undocker coverage.html
2021-06-01 05:49:39 +00:00
undocker: $(GODEPS)
CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build
2021-06-01 05:42:23 +00:00
.PHONY: test
test:
2021-06-01 06:00:27 +00:00
go test -race -cover ./...
.PHONY: lint
2021-06-01 16:47:45 +00:00
lint: vet staticcheck
.PHONY: vet
vet:
2021-06-01 06:00:27 +00:00
go vet ./...
2021-06-01 16:47:45 +00:00
.PHONY: staticcheck
staticcheck:
2021-06-01 06:10:10 +00:00
$(GOBIN)staticcheck -f stylish ./...
2021-06-01 05:42:23 +00:00
.INTERMEDIATE: coverage.out
2021-06-01 05:49:39 +00:00
coverage.out: $(GODEPS)
2021-06-01 05:42:23 +00:00
go test -coverprofile $@ ./...
coverage.html: coverage.out
go tool cover -html=$< -o $@
2021-06-01 16:54:55 +00:00
.PHONY: clean
clean:
rm -f coverage.html undocker