-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
39 lines (28 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
BINARY_NAME=changedetectionio_exporter
GOCOVER=go tool cover
GOTESTSUM=go run gotest.tools/gotestsum@latest
GOLANGCILINT=go run github.com/golangci/golangci-lint/cmd/golangci-lint@latest
.DEFAULT_GOAL := all
.PHONY: clean test watch cover run start
all: clean test build
docker:
docker buildx build --platform linux/amd64,linux/arm64,linux/arm/v7 -t ghcr.io/schaermu/changedetection.io-exporter:latest .
build:
GOARCH=amd64 GOOS=linux go build -o ./build/${BINARY_NAME} .
run:
./build/${BINARY_NAME}
start: clean build run
clean:
go clean
go clean -testcache
rm -rf ./build
lint:
$(GOLANGCILINT) run ./...
test:
$(GOTESTSUM) -f standard-verbose -- -tags=test -coverprofile=coverage.txt -race -covermode=atomic ./pkg/...
watch:
$(GOTESTSUM) --watch -f testname -- -tags=test -coverprofile=coverage.txt -race -covermode=atomic ./...
cover:
$(GOTESTSUM) -f pkgname -- -tags=test -coverprofile=coverage.out -race -covermode=atomic ./pkg/...
$(GOCOVER) -func=coverage.out
$(GOCOVER) -html=coverage.out -o coverage.html