-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
48 lines (35 loc) · 1.12 KB
/
Makefile
File metadata and controls
48 lines (35 loc) · 1.12 KB
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
BINARY := skern
MODULE := github.com/devrimcavusoglu/skern
VERSION ?= $(shell git describe --tags --always --dirty 2>/dev/null || echo "dev")
COMMIT ?= $(shell git rev-parse --short HEAD 2>/dev/null || echo "none")
DATE ?= $(shell date -u +%Y-%m-%dT%H:%M:%SZ)
LDFLAGS := -s -w \
-X '$(MODULE)/internal/cli.Version=$(VERSION)' \
-X '$(MODULE)/internal/cli.Commit=$(COMMIT)' \
-X '$(MODULE)/internal/cli.Date=$(DATE)'
.PHONY: build test test-v test-cover test-install test-smoke test-manual-setup test-manual-report test-manual-teardown lint fmt clean
build:
go build -ldflags "$(LDFLAGS)" -o $(BINARY) ./cmd/skern
test:
go test ./...
test-install:
bash scripts/install_test.sh
test-smoke: build
bash scripts/smoke_test.sh ./skern
test-manual-setup: build
bash tests/manual/setup.sh
test-manual-report:
bash tests/manual/report.sh
test-manual-teardown:
bash tests/manual/teardown.sh
test-v:
go test -v ./...
test-cover:
go test -coverprofile=coverage.out ./...
go tool cover -html=coverage.out -o coverage.html
lint:
golangci-lint run
fmt:
gofmt -w .
clean:
rm -f $(BINARY) coverage.out coverage.html