ci: makefile commands to test, lint and format
Some checks failed
ci/woodpecker/push/ci Pipeline was successful
CI / test (push) Has been cancelled
Release / release (push) Has been cancelled
Some checks failed
ci/woodpecker/push/ci Pipeline was successful
CI / test (push) Has been cancelled
Release / release (push) Has been cancelled
This commit is contained in:
parent
ba23c2816c
commit
7c588033c9
3 changed files with 67 additions and 3 deletions
16
Makefile
16
Makefile
|
@ -5,6 +5,8 @@ SOURCE_FILES ?=./...
|
|||
TEST_OPTIONS ?= -v -failfast -race -bench=. -benchtime=100000x -cover -coverprofile=coverage.out
|
||||
TEST_TIMEOUT ?=1m
|
||||
|
||||
GOLANGCI_LINT_VERSION ?= v1.64.5
|
||||
|
||||
CLEAN_OPTIONS ?=-modcache -testcache
|
||||
|
||||
CGO_ENABLED := 0
|
||||
|
@ -78,13 +80,21 @@ run: ### Executes the project build locally
|
|||
.PHONY: format
|
||||
format: ### Executes the formatting pipeline on the project
|
||||
$(info: Make: Format)
|
||||
@bash scripts/format.sh
|
||||
@go fmt ./...
|
||||
@go mod tidy
|
||||
|
||||
.PHONY: ci-lint
|
||||
ci-lint: ### Check the project for errors
|
||||
$(info: Make: Lint)
|
||||
@go install github.com/golangci/golangci-lint/cmd/golangci-lint@${GOLANGCI_LINT_VERSION}
|
||||
@golangci-lint run ./...
|
||||
|
||||
.PHONY: lint
|
||||
lint: ### Check the project for errors
|
||||
$(info: Make: Lint)
|
||||
@bash scripts/lint.sh
|
||||
@golangci-lint run ./...
|
||||
|
||||
.PHONY: test
|
||||
test: ### Runs the test suite
|
||||
@bash scripts/test.sh
|
||||
$(info: Make: Test)
|
||||
CGO_ENABLED=1 go test ${TEST_OPTIONS} -timeout=${TEST_TIMEOUT} ${SOURCE_FILES}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue