Skip to content

Commit

Permalink
chore(Makefile):add test target
Browse files Browse the repository at this point in the history
  • Loading branch information
vimiix committed Dec 17, 2023
1 parent d46590a commit 105ddce
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ LDFLAGS += -X "$(REPO)/ssx/version.Revision=$(COMMIT)"
LDFLAGS += -X "$(REPO)/ssx/version.BuildDate=$(BUILDDATE)"
LDFLAGS += $(EXTRA_LDFLAGS)
FILES := $$(find . -name "*.go")
TEST_FILES := $$(go list ./...)

.PHONY: help
help: ## print help info
Expand All @@ -34,6 +35,10 @@ lint: tidy fmt ## lint code with golangci-lint
$([[ command -v golangci-lint ]] || go install github.com/golangci/golangci-lint/cmd/golangci-lint@v1.51.1)
@golangci-lint run -v

.PHONY: test
test: ## run all unit tests
$(GO) test -gcflags=all=-l $(TEST_FILES) -coverprofile dist/cov.out -covermode count

.PHONY: ssx
ssx: lint ## build ssx binary
$(GO) build -ldflags '$(LDFLAGS)' -gcflags '-N -l' -o dist/ssx ./cmd/ssx/main.go
Expand Down

0 comments on commit 105ddce

Please sign in to comment.