-
Notifications
You must be signed in to change notification settings - Fork 34
Expand file tree
/
Copy pathMakefile
More file actions
39 lines (31 loc) · 974 Bytes
/
Makefile
File metadata and controls
39 lines (31 loc) · 974 Bytes
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
ROOT_DIR ?= $(shell git rev-parse --show-toplevel)
SCRIPTS_BASE ?= $(ROOT_DIR)/scripts
GOLANG_CI_YAML_PATH ?= ${ROOT_DIR}/golang-ci.yaml
GOLANG_CI_ARGS ?= --allow-parallel-runners --config=${GOLANG_CI_YAML_PATH}
# Build
build:
@go build -o ./bin/stackit
fmt:
@gofmt -s -w .
@go tool goimports -w .
# Lint
lint-golangci-lint:
@echo ">> Linting with golangci-lint"
@go tool golangci-lint run ${GOLANG_CI_ARGS}
lint-yamllint:
@echo ">> Linting with yamllint"
@yamllint -c .yamllint.yaml .
lint: lint-golangci-lint lint-yamllint
# Test
test:
@echo ">> Running tests for the CLI application"
@go test ./... -count=1 -coverprofile=coverage.out
# Test coverage
coverage:
@echo ">> Creating test coverage report for the CLI application"
@go test ./... -coverprofile=coverage.out || true
@go tool cover -html=coverage.out -o coverage.html
# Generate docs
generate-docs:
@echo ">> Generating docs..."
@go run $(SCRIPTS_BASE)/generate.go