You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

33 lines
1.1 KiB

  1. ###### Help ###################################################################
  2. .DEFAULT_GOAL = help
  3. .PHONY: help
  4. help: ## list Makefile targets
  5. @grep -E '^[a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) | sort | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-30s\033[0m %s\n", $$1, $$2}'
  6. ###### Targets ################################################################
  7. test: version download fmt vet ginkgo ## Runs all build, static analysis, and test steps
  8. download: ## Download dependencies
  9. go mod download
  10. vet: ## Run static code analysis
  11. go vet ./...
  12. ginkgo: ## Run tests using Ginkgo
  13. go run github.com/onsi/ginkgo/ginkgo -p -r --randomizeAllSpecs --failOnPending --randomizeSuites --race
  14. fmt: ## Checks that the code is formatted correcty
  15. @@if [ -n "$$(gofmt -s -e -l -d .)" ]; then \
  16. echo "gofmt check failed: run 'gofmt -s -e -l -w .'"; \
  17. exit 1; \
  18. fi
  19. docker_test: ## Run tests in a container via docker-compose
  20. docker-compose build test && docker-compose run --rm test make test
  21. version: ## Display the version of Go
  22. @@go version