-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
46 lines (36 loc) · 1.29 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
BINARY_DIR=bin
BINARY_NAME=doco-cd
.PHONY: test build run lint fmt update update-all submodule-commit generate-coverage
test:
@echo "Running tests..."
@WEBHOOK_SECRET="test_Secret1" go test -v -cover -p 1 ./... -timeout 5m
test-coverage:
@echo "Running tests with coverage..."
@WEBHOOK_SECRET="test_Secret1" go test -v -coverprofile cover.out ./...
@go tool cover -html cover.out -o cover.html
build:
mkdir -p $(BINARY_DIR)
go build -o $(BINARY_DIR) ./...
lint:
golangci-lint run ./...
fmt:
go fmt ./...
-go run mvdan.cc/gofumpt@latest -l -w .
-go run golang.org/x/tools/cmd/goimports@latest -l -w .
-go run github.com/bombsimon/wsl/v4/cmd...@latest -strict-append -test=true -fix ./...
-go run github.com/catenacyber/perfsprint@latest -fix ./...
update:
git pull origin main
git submodule update --init --recursive
update-all: update
git submodule foreach git pull origin master
git submodule foreach git checkout master
wiki-commit:
git submodule foreach "git add . && git commit -m 'docs: update wiki' && git push"
git add docs/ && git commit -m 'docs: update wiki' && git push
download:
@echo Download go.mod dependencies
@go mod download
install-devtools: download
@echo Installing tools from tools.go
@cat tools/tools.go | grep _ | awk -F'"' '{print $$2}' | xargs -tI % go install %