2021-10-17 10:07:39 +02:00
|
|
|
BINARY_NAME=gitea-sonarqube-bot
|
|
|
|
|
|
|
|
export GO111MODULE=on
|
|
|
|
|
|
|
|
help:
|
|
|
|
@echo "Make Routines:"
|
|
|
|
@echo " - build Build the bot"
|
|
|
|
@echo " - run Start the bot"
|
|
|
|
@echo " - clean Delete generated files"
|
2021-10-17 10:53:54 +02:00
|
|
|
@echo " - test Run full test suite"
|
|
|
|
@echo " - test p=./path/to/package Run test suite for specific package"
|
|
|
|
@echo " - test\#SpecificTestName Run a specific"
|
|
|
|
@echo " - coverage Run full test suite and generates coverage report as HTML file"
|
2021-10-17 10:07:39 +02:00
|
|
|
@echo " - dep Dependency maintenance (tidy, vendor, verify)"
|
|
|
|
@echo " - vet Examine Go source code and reports suspicious parts"
|
|
|
|
@echo " - fmt Format the Go code"
|
|
|
|
@echo " - help Print this help"
|
|
|
|
|
|
|
|
build:
|
2021-10-17 10:53:54 +02:00
|
|
|
GOARCH=amd64 GOOS=linux go build -mod=vendor -o ${BINARY_NAME} ./cmd/gitea-sonarqube-bot/
|
2021-10-17 10:07:39 +02:00
|
|
|
|
|
|
|
run:
|
|
|
|
./${BINARY_NAME}
|
|
|
|
|
|
|
|
clean:
|
|
|
|
go clean
|
|
|
|
rm -f ${BINARY_NAME}
|
2021-10-17 12:16:42 +02:00
|
|
|
rm -f cover.out cover.html test-report.out
|
2021-10-17 10:07:39 +02:00
|
|
|
|
|
|
|
test:
|
2021-10-17 10:53:54 +02:00
|
|
|
ifdef p
|
|
|
|
go test -v -mod=vendor $(p)
|
|
|
|
else
|
|
|
|
go test -v -mod=vendor ./...
|
|
|
|
endif
|
|
|
|
|
|
|
|
test\#%:
|
|
|
|
go test -mod=vendor -run $(subst .,/,$*) ./...
|
2021-10-17 10:07:39 +02:00
|
|
|
|
2021-10-17 12:16:42 +02:00
|
|
|
test-ci:
|
|
|
|
go test -mod=vendor -coverprofile=cover.out -json ./... > test-report.out
|
|
|
|
|
2021-10-17 10:07:39 +02:00
|
|
|
coverage:
|
2021-10-17 10:53:54 +02:00
|
|
|
go test -coverprofile=cover.out ./...
|
2021-10-17 10:07:39 +02:00
|
|
|
go tool cover -html=cover.out -o cover.html
|
|
|
|
|
|
|
|
dep:
|
|
|
|
go mod tidy
|
|
|
|
go mod vendor
|
|
|
|
go mod verify
|
|
|
|
|
|
|
|
vet:
|
|
|
|
go vet ./...
|
|
|
|
|
|
|
|
fmt:
|
|
|
|
go fmt ./...
|