forked from DataDog/jamf-api-client-go
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
51 lines (40 loc) · 1.47 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
51
DIRS := $(shell go list ./...)
.PHONY: help deps fmt lint test test-race test-integration
help:
@echo ""
@echo "Welcome to DataDog/jamf-api-client-go make."
@echo "The following commands are available:"
@echo ""
@echo " make clean : Cleanup all test files and binaries"
@echo " make deps : Fetch all dependencies"
@echo " make fmt : Run go fmt to fix any formatting issues"
@echo " make lint : Use go vet to check for linting issues"
@echo " make test : Run all short tests"
@echo " make test-race : Run all tests with race condition checking"
@echo " make test-integration : Run all tests without limiting to short"
@echo ""
@echo " make pr-prep : Run this before making a PR to run fmt, lint and tests"
@echo ""
clean:
rm -f cp.out
rm -f .coverage.html
rm -rf bin/
rm -rf vendor/
deps:
@go mod tidy
fmt:
@go fmt ${DIRS}
lint:
@go vet ${DIRS}
test:
@go test -v -coverprofile=cp.out -count=1 -timeout 300s -short ${DIRS}
go tool cover -html=cp.out -o .coverage.html
test-race:
@go test -v -coverprofile=cp.out -count=1 -timeout 300s -short -race ${DIRS}
go tool cover -html=cp.out -o .coverage.html
test-integration:
@go test -v -coverprofile=cp.out -count=1 -timeout 600s ${DIRS}
go tool cover -html=cp.out -o .coverage.html
build:
@go build -ldflags="-s -w" -o bin/jamf-api-client-go ./classic
pr-prep: clean deps fmt lint test-race test-integration