-
Notifications
You must be signed in to change notification settings - Fork 1
/
Makefile
48 lines (35 loc) · 1.15 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
## variables
GOCMD?=go
CODE_COVERAGE_FILE:= coverage
CODE_COVERAGE_FILE_TXT := $(CODE_COVERAGE_FILE).txt
PACKAGE_BASE=github.com/buildpacks/scafall
SRC=$(shell find . -type f -name '*.go' -not -path "*/testdata/*")
all: build verify test
build:
go build -o scafall main.go
test: lint test-unit test-integration test-system
install-golangci-lint:
@echo "> Installing golangci-lint..."
cd tools && $(GOCMD) install github.com/golangci/golangci-lint/cmd/golangci-lint
install-go-acc:
@echo " installing go-acc"
cd tools && $(GOCMD) install github.com/ory/go-acc
test-unit: install-go-acc
@echo " running unit tests"
go-acc ./pkg/... -o $(CODE_COVERAGE_FILE_TXT)
test-integration:
go test ./test_integration/ -count=1
test-system:
go test ./test_system/ -count=1
install-goimports:
@echo "> Installing goimports..."
cd tools && $(GOCMD) install golang.org/x/tools/cmd/goimports
verify-format: install-goimports
@echo "> Formating code..."
@goimports -l -local ${PACKAGE_BASE} ${SRC}
format: install-goimports
@echo "> Formating code..."
@goimports -l -w -local ${PACKAGE_BASE} ${SRC}
lint: install-golangci-lint
golangci-lint run
verify: lint verify-format