-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
57 lines (47 loc) · 1.71 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
52
53
54
55
56
57
# ==================================================================================== #
# HELPERS
# ==================================================================================== #
## help: print this help message
.PHONY: help
help:
@echo 'Usage:'
@sed -n 's/^##//p' ${MAKEFILE_LIST} | column -t -s ':' | sed -e 's/^/ /'
# ==================================================================================== #
# QUALITY CONTROL
# ==================================================================================== #
## tidy: format code and tidy modfile
.PHONY: tidy
tidy:
go fmt ./...
go get -u ./...
go mod tidy -v
## audit: run quality control checks
.PHONY: audit
audit:
go mod verify
go vet ./...
## lint: run lint control checks
.PHONY: lint
lint:
go install github.com/golangci/golangci-lint/cmd/golangci-lint@latest
golangci-lint run
# ==================================================================================== #
# DEVELOPMENT
# ==================================================================================== #
## test: run all tests
.PHONY: test
test:
CGO_ENABLED=1 go test -v -race -buildvcs ./...
## test/cover: run all tests and display coverage
.PHONY: test/cover
test/cover:
CGO_ENABLED=1 go test -v -race -buildvcs -coverprofile=/tmp/coverage.out ./...
go tool cover -html=/tmp/coverage.out
## build: build the cmd/rest application
.PHONY: build
build:
go build -ldflags "-X 'radicle-github-actions-adapter/pkg/version.Version=development' -X 'radicle-github-actions-adapter/pkg/version.BuildTime=$(shell date)'" -o=/tmp/bin/radicle-github-actions-adapter ./cmd/github-actions-adapter
## run: run the cmd/rest application
.PHONY: run
run: build
/tmp/bin/radicle-github-actions-adapter