File: Makefile

package info (click to toggle)
golang-github-ibm-sarama 1.45.1-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, trixie
  • size: 2,964 kB
  • sloc: makefile: 35; sh: 19
file content (39 lines) | stat: -rw-r--r-- 1,308 bytes parent folder | download | duplicates (2)
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
default: fmt get update test lint

GO       := go
GOBIN    := $(shell pwd)/bin
GOBUILD  := CGO_ENABLED=0 $(GO) build $(BUILD_FLAG)
GOTEST   := $(GO) test -v -race -coverprofile=profile.out -covermode=atomic

FILES    := $(shell find . -name '*.go' -type f -not -name '*.pb.go' -not -name '*_generated.go' -not -name '*_test.go')
TESTS    := $(shell find . -name '*.go' -type f -not -name '*.pb.go' -not -name '*_generated.go' -name '*_test.go')

$(GOBIN)/tparse:
	GOBIN=$(GOBIN) go install github.com/mfridman/tparse@v0.16.0
get:
	$(GO) get ./...
	$(GO) mod verify
	$(GO) mod tidy

update:
	$(GO) get -u -v ./...
	$(GO) mod verify
	$(GO) mod tidy

fmt:
	gofmt -s -l -w $(FILES) $(TESTS)

lint:
	GOFLAGS="-tags=functional" golangci-lint run

test: $(GOBIN)/tparse
	$(GOTEST) -timeout 2m -json ./... \
		| tee output.json | $(GOBIN)/tparse -follow -all
	[ -z "$${GITHUB_STEP_SUMMARY}" ] \
		|| NO_COLOR=1 $(GOBIN)/tparse -format markdown -file output.json -all >"$${GITHUB_STEP_SUMMARY:-/dev/null}"
.PHONY: test_functional
test_functional: $(GOBIN)/tparse
	$(GOTEST) -timeout 15m -tags=functional -json ./... \
		| tee output.json | $(GOBIN)/tparse -follow -all
	[ -z "$${GITHUB_STEP_SUMMARY:-}" ] \
		|| NO_COLOR=1 $(GOBIN)/tparse -format markdown -file output.json -all >"$${GITHUB_STEP_SUMMARY:-/dev/null}"