-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
50 lines (39 loc) · 1.01 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
50
#!/usr/bin/env make
SERVICE_NAME=aws-ssh
VERSION_FILE:=./VERSION
BRANCH:=$(shell git branch 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/\1/' | tr '/' '-')
## clean up dependencies
mod-tidy:
go mod tidy
.PHONY: mod-tidy
## download dependencies
mod-dl:
go mod download
.PHONY: mod-dl
## install golangci-lint
install-lint:
go install github.com/golangci/golangci-lint/cmd/golangci-lint@v1.54.2
.PHONY: install-lint
## run linters on code
lint: install-lint code-gen
golangci-lint run ./... --out-format checkstyle > lint.out
.PHONY: lint
## run linters in fix mode on code
lint-fix: install-lint
golangci-lint run --fix ./...
.PHONY: lint
code-gen:
go generate ./...
.PHONY: code-gen
## run unit tests
test: code-gen
go test ./... -covermode=set -coverprofile=coverage.out
.PHONY: test
# test without running code-gen, to check mocks are up to date
test-ci:
go test ./... -covermode=set -coverprofile=coverage.out -json > tests.out
.PHONY: test-ci
## build application
compile:
go build ./...
.PHONY: compile