1
0
mirror of https://github.com/xorcare/testing-go-code-with-postgres.git synced 2025-06-30 23:23:40 +02:00
Files
testing-go-code-with-postgres/Makefile
Vasiliy Vasilyuk c3496db60e Bump golangci/golangci-lint-action from 6 to 7
Bumps [golangci/golangci-lint-action](https://github.com/golangci/golangci-lint-action) from 6 to 7.
- [Release notes](https://github.com/golangci/golangci-lint-action/releases)
- [Commits](https://github.com/golangci/golangci-lint-action/compare/v6...v7)

---
updated-dependencies:
- dependency-name: golangci/golangci-lint-action
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-04-05 08:41:53 +00:00

41 lines
1.1 KiB
Makefile

.DEFAULT_GOAL := help
COVER_FILE ?= coverage.out
.PHONY: build
build: ## Build a command to quickly check compiles.
@go build ./...
.PHONY: check
check: lint build test ## Runs all necessary code checks.
@go mod tidy
.PHONY: test
test: ## Run all tests.
@go test -race -count=1 -coverprofile=$(COVER_FILE) ./...
@go tool cover -func=$(COVER_FILE) | grep ^total | tr -s '\t'
.PHONY: test-short
test-short: ## Run only unit tests, tests without I/O dependencies.
@go test -short ./...
.PHONY: test-env-up
test-env-up: ## Run test environment.
@docker compose up --exit-code-from migrate migrate
.PHONY: test-env-down
test-env-down: ## Down and cleanup test environment.
@docker compose down -v
.PHONY: lint
lint: tools ## Check the project with lint.
@golangci-lint run --fix ./...
.PHONY: tools
tools: ## Install all needed tools, e.g.
@go install github.com/golangci/golangci-lint/v2/cmd/golangci-lint@v2.0.2
.PHONY: help
help: ## Show help for each of the Makefile targets.
@grep -E '^[a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-30s\033[0m %s\n", $$1, $$2}'