-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
45 lines (32 loc) · 1.05 KB
/
Copy pathMakefile
File metadata and controls
45 lines (32 loc) · 1.05 KB
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
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
BIN := apple-compose
VERSION ?= $(shell git describe --tags --always --dirty 2>/dev/null || echo "dev")
LDFLAGS := -s -w -X main.version=$(VERSION)
.PHONY: build test test-integration lint vet fmt coverage coverage-html install clean clean-containers release-dry
build:
go build -ldflags "$(LDFLAGS)" -o $(BIN) .
test:
go test -race ./...
test-integration:
go test -tags integration -v -timeout 20m ./integration/
vet:
go vet ./...
fmt:
gofmt -w . cmd/ internal/ integration/
@which goimports > /dev/null && goimports -w cmd/ internal/ integration/ || true
lint:
golangci-lint run --timeout=5m
coverage:
go test -race -coverprofile=coverage.out ./...
go tool cover -func=coverage.out
coverage-html: coverage
go tool cover -html=coverage.out -o coverage.html
open coverage.html
install: build
mv $(BIN) /usr/local/bin/$(BIN)
clean:
rm -f $(BIN) coverage.out coverage.html
clean-containers:
-./$(BIN) -f testdata/docker-compose.yml down 2>/dev/null || true
-container prune 2>/dev/null || true
release-dry:
goreleaser release --snapshot --clean