-
Notifications
You must be signed in to change notification settings - Fork 15
/
Makefile
41 lines (32 loc) · 1.03 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
SHELL = /bin/bash
export
LINT_VERSION="1.59.1"
.PHONY: all
all: deps lint test
.PHONY: deps
deps:
@if ! which golangci-lint >/dev/null || [[ "$$(golangci-lint --version)" != *${LINT_VERSION}* ]]; then \
curl -sfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b $(shell go env GOPATH)/bin v${LINT_VERSION}; \
fi
.PHONY: update-deps
update-deps:
go get -u ./...
.PHONY: lint-fix
lint-fix: deps
golangci-lint run --fix # Attempts to fix some lint errors
.PHONY: lint
lint: deps
golangci-lint run --timeout 5m
go install github.com/securego/gosec/v2/cmd/gosec@latest && gosec ./...
.PHONY: test
test: int-setup
go test -v -race -covermode=atomic -coverprofile=coverage.out ./rules/...
go run v3enginetest/main.go
.PHONY: int-setup
int-setup: int-teardown
docker run -d -p 2379:2379 --name etcd quay.io/coreos/etcd:v3.5.9 \
/usr/local/bin/etcd --listen-client-urls http://0.0.0.0:2379 \
--advertise-client-urls http://0.0.0.0:2379
.PHONY: int-teardown
int-teardown:
docker rm -f etcd || true