forked from benjojo/alertmanager-discord
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
46 lines (35 loc) · 1.39 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
PACKAGES="./..."
# build paramters
BUILD_FOLDER = dist
APP_VERSION = $(git describe --tags --always)
###############################################################################
### Basic Golang Commands ###
###############################################################################
all: install
install: go.sum
go install main.go
install-debug: go.sum
go build -gcflags="all=-N -l" -o $(BUILD_FOLDER)/alertmanager-discord cmd/alertmanager-discord.go
build: clean
@echo build binary to $(BUILD_FOLDER)
goreleaser build --single-target --config .github/.goreleaser.yaml --snapshot --rm-dist
@echo done
clean:
@echo clean build folder $(BUILD_FOLDER)
rm -rf $(BUILD_FOLDER)
@echo done
go.sum: go.mod
@echo "--> Ensure dependencies have not been modified"
GO111MODULE=on go mod verify
test:
@go test -mod=readonly $(PACKAGES) -cover -race
lint:
@echo "--> Running linter"
@golangci-lint run --config .github/.golangci.yaml
@go mod verify
###############################################################################
### CI / CD ###
###############################################################################
# TODO: running this with -race options causes problems in the cli tests
test-ci:
go test -coverprofile=coverage.txt -covermode=atomic -mod=readonly $(PACKAGES)