-
Notifications
You must be signed in to change notification settings - Fork 12
Expand file tree
/
Copy pathMakefile
More file actions
90 lines (69 loc) · 1.87 KB
/
Copy pathMakefile
File metadata and controls
90 lines (69 loc) · 1.87 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
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
SOURCE_FILES?=./...
GOLANGCI_VERSION=v2.11.4 # Also update golangci-lint GH action in pr.yml when updating this version
export GO111MODULE := on
export PATH := ./bin:$(PATH)
default: build
.PHONY: link-git-hooks
link-git-hooks:
find .git/hooks -type l -exec rm {} \;
find githooks -type f -exec ln -sf ../../{} .git/hooks/ \;
.PHONY: build
build:
go install $(SOURCE_FILES)
.PHONY: test
test:
go test $(SOURCE_FILES) -timeout=30s -parallel=4 -race
.PHONY: test-examples
test-examples:
cd examples && go test ./...
.PHONY: fmt
fmt:
@echo "==> Fixing source code with gofmt..."
gofmt -s -w ./**/**/*.go
.PHONY: lint-fix
lint-fix:
./bin/golangci-lint run --fix
.PHONY: lint
lint:
./bin/golangci-lint run $(SOURCE_FILES)
.PHONY: check
check: test lint-fix
.PHONY: install-golangci-lint
install-golangci-lint:
GOBIN=$(shell pwd)/bin go install github.com/golangci/golangci-lint/v2/cmd/golangci-lint@$(GOLANGCI_VERSION)
.PHONY: install-goimports
install-goimports:
go install golang.org/x/tools/cmd/goimports@latest
.PHONY: tools
tools: install-golangci-lint install-goimports
.PHONY: addcopy
addcopy:
@scripts/add-copy.sh
TAG=$(patsubst v%,%,$(shell git describe --tags --dirty --always))
.PHONY: check-version
check-version:
scripts/check-version.sh "$(TAG)"
.PHONY: openapi-pipeline
openapi-pipeline: install-goimports
echo "Running OpenAPI Generation and Validation process"
$(MAKE) -C tools clean_client
echo "Running client generation"
$(MAKE) -C tools generate_client
echo "Validating generated SDK"
go test ./test
.PHONY: gen-docs
gen-docs:
$(MAKE) -C tools generate_docs
./scripts/toc.sh
.PHONY: gen-purls
gen-purls:
./scripts/compliance/gen-purls.sh
.PHONY: gen-sbom
gen-sbom:
./scripts/compliance/gen-sbom.sh
.PHONY: gen-ssdlc-report
gen-ssdlc-report:
./scripts/compliance/gen-ssdlc-report.sh
.PHONY: upload-sbom
upload-sbom:
./scripts/compliance/upload-sbom.sh