-
Notifications
You must be signed in to change notification settings - Fork 3
/
Makefile
30 lines (29 loc) · 839 Bytes
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
.PHONY: build
COVERAGEDIR = .coverage
GITSHA = $(shell git rev-parse HEAD)
LDFLAGS = -ldflags '-X main.gitSHA=$(GITSHA)'
all: build test cover
dependencies:
go mod download
build:
if [ ! -d bin ]; then mkdir bin; fi
go build $(LDFLAGS) -v -o bin/go-rest-assured ./cmd/go-assured
docker-build:
docker build -f ./build/Dockerfile -t go-rest-assured:$(GITSHA) .
fmt:
go mod tidy
gofmt -w -l -s .
golangci-lint run ./...
assert-no-diff:
test -z "$(shell git status --porcelain)"
test: fmt
if [ ! -d $(COVERAGEDIR) ]; then mkdir $(COVERAGEDIR); fi
go test -v ./pkg/... -cover -coverprofile=$(COVERAGEDIR)/assured.coverprofile
cover:
if [ ! -d $(COVERAGEDIR) ]; then mkdir $(COVERAGEDIR); fi
go tool cover -html=$(COVERAGEDIR)/assured.coverprofile
clean:
go clean
rm -f bin/go-rest-assured
rm -rf $(COVERAGEDIR)
rm -rf vendor/