-
Notifications
You must be signed in to change notification settings - Fork 4
/
Makefile
49 lines (37 loc) · 1.61 KB
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
PKG_VERSION := v1.2.2
GIT_COMMIT ?= $(shell git rev-parse --short HEAD 2> /dev/null || true)
BUILD_DATE := $(shell date -u +%Y-%m-%dT%T 2> /dev/null)
.PHONY: clean
clean: ## Remove temporary files and build artifacts
go clean -v ./...
rm -rf bin
rm -f coverage.out
.PHONY: cover
cover: test-unit ## Run unit tests and open the coverage report
go tool cover -html=coverage.out
.PHONY: changelog
changelog: ## Generate changelog from commits via Docker
docker run -it --rm -v "$(pwd)":/usr/local/src/your-app githubchangeloggenerator/github-changelog-generator -u veryfi -p veryfi-go -t FIXME_GITHUB_ACCESS_TOKEN
.PHONY: fmt
fmt: ## Run gofmt on all files
gofmt -s -w .
.PHONY: github-tag
github-tag: ## Create and push a tag with the current client version
git tag -a ${PKG_VERSION} -m "Veryfi Go Client ${PKG_VERSION}"
git push -u origin ${PKG_VERSION}
.PHONY: lint
lint: ## Lint project source files via Docker
docker run --rm -v $(shell pwd):/app -w /app golangci/golangci-lint:v1.39.0 golangci-lint run
.PHONY: test-unit
test-unit: ## Run unit tests
go test -race -cover -run Unit -coverprofile=coverage.out -covermode=atomic ./...
.PHONY: test-integration
test-integration: ## Run integration tests
CLIENT_ID=FIXME CLIENT_SECRET=FIXME USERNAME=FIXME API_KEY=FIXME go test -race -cover -run Integration -coverprofile=coverage.out -covermode=atomic ./...
.PHONY: version
version: ## Print the version
@echo "${PKG_VERSION}"
.PHONY: help
help: ## Print usage information
@awk 'BEGIN {FS = ":.*?## "} /^[a-zA-Z_-]+:.*?## / {printf "\033[36m%-20s\033[0m %s\n", $$1, $$2}' $(MAKEFILE_LIST) | sort
.DEFAULT_GOAL := help