forked from open-telemetry/opentelemetry-collector
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile.Common
61 lines (48 loc) · 1.18 KB
/
Makefile.Common
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
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
# ALL_PKGS is the list of all packages where ALL_SRC files reside.
ALL_PKGS := $(sort $(shell go list ./...))
# Use a single process (-p 1) on go test to avoid tests clashing on machine
# wide resources, e.g. ports.
GOTEST_OPT?= -v -p 1 -race -timeout 120s
GOCMD?= go
GOTEST=$(GOCMD) test
GO_ACC=go-acc
LINT=golangci-lint
IMPI=impi
GOOS := $(shell $(GOCMD) env GOOS)
GOARCH := $(shell $(GOCMD) env GOARCH)
GH := $(shell which gh)
.PHONY: test
test:
$(GOTEST) $(GOTEST_OPT) ./...
.PHONY: test-unstable
test-unstable:
$(GOTEST) $(GOTEST_OPT) -tags enable_unstable ./...
.PHONY: test-with-cover
test-with-cover:
$(GO_ACC) --output=coverage.out ./...
.PHONY: benchmark
benchmark:
$(GOTEST) -bench=. -run=notests ./...
.PHONY: fmt
fmt:
gofmt -w -s ./
goimports -w -local go.opentelemetry.io/collector ./
.PHONY: tidy
tidy:
rm -fr go.sum
$(GOCMD) mod tidy -compat=1.17
.PHONY: lint
lint:
$(LINT) run
.PHONY: lint-unstable
lint-unstable:
$(LINT) run --build-tags enable_unstable
.PHONY: generate
generate:
$(GOCMD) generate ./...
.PHONY: impi
impi:
@$(IMPI) --local go.opentelemetry.io/collector --scheme stdThirdPartyLocal ./...
.PHONY: moddownload
moddownload:
$(GOCMD) mod download