-
Notifications
You must be signed in to change notification settings - Fork 1
/
Makefile
54 lines (45 loc) · 1.39 KB
/
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
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
default: init
.PHONY: init
init: init/lint
.PHONY: init/lint init/vulnCheck
init/lint:
go install github.com/golangci/golangci-lint/cmd/[email protected]
go install golang.org/x/tools/go/analysis/passes/fieldalignment/cmd/[email protected]
.PHONY: init/vulnCheck
init/vulnCheck:
go install golang.org/x/vuln/cmd/govulncheck@latest
.PHONY: audit
audit: vendor
@echo 'Formatting code...'
fieldalignment -fix ./...
golangci-lint run -c .golangci.yml --timeout=5m -v --fix
@echo 'Vetting code...'
go vet ./...
@echo 'Vulnerability scanning...'
govulncheck ./...
.PHONY: tidy
tidy:
@echo 'Tidying and verifying module dependencies...'
go mod tidy -compat=1.22.4
go mod verify
.PHONY: tidy/all
tidy/all:
go mod tidy
cd example/elasticsearch && go mod tidy && cd ../..
cd example/kafka && go mod tidy && cd ../..
cd example/postgresql && go mod tidy && cd ../..
cd example/simple && go mod tidy && cd ../..
cd example/simple-file-config && go mod tidy && cd ../..
cd integration_test && go mod tidy && cd ../
cd benchmark/go-pq-cdc-kafka && go mod tidy && cd ../..
.PHONY: test/integration
test/integration:
cd integration_test && go test -race -p=1 -v ./...
.PHONY: lint
lint: init/lint
@echo 'Formatting code...'
fieldalignment -fix ./...
golangci-lint run -c .golangci.yml --timeout=5m -v --fix
.PHONY: build
build/linux:
GOOS=linux CGO_ENABLED=0 GOARCH=amd64 go build -trimpath -a -v