-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
79 lines (63 loc) · 1.78 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
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
# Copyright 2024 Zaphiro Technologies
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
all: proto-lint generate lint test docs
.PHONY: lint
lint:
golangci-lint run --fix
.PHONY: test
test:
go test ./...
.PHONY: bench
bench:
go test ./... -bench=. -run=^$
.PHONY: cov
cov:
mkdir -p coverage && \
go test ./... -coverpkg=./... -coverprofile=./coverage/coverage.out && \
gcov2lcov -infile=./coverage/coverage.out -outfile=./coverage/lcov.info
.PHONY: generate
generate:
buf generate
.PHONY: docs
docs:
mkdir -p docs
../proto-gen-md-diagrams/proto-gen-md-diagrams -d zaphiro -o docs -md true
.PHONY: proto-lint
proto-lint:
buf lint
docker-compose:
docker compose -f .docker/docker-compose.yml up -d
.PHONY: docker-start
docker-start: docker-compose sleep create-rabbit-defaults
.PHONY: docker-stop
docker-stop:
docker compose -f .docker/docker-compose.yml down -v
.PHONY: sleep
sleep:
sleep 10
.PHONY: create-rabbit-defaults
create-rabbit-defaults:
docker exec rabbitmq ./init.sh
.PHONY: example-measurements-go
example-measurements-go:
cd examples/go/measurements && go run main.go
.PHONY: example-faults-go
example-faults-go:
cd examples/go/faults && go run main.go
# Mandatory
ci-test: cov
# Mandatory if benchmark enabled
ci-bench: bench
# Mandatory for docker build but can be empty
ci-pre-build: