-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathTaskfile.yml
More file actions
86 lines (73 loc) · 2.37 KB
/
Taskfile.yml
File metadata and controls
86 lines (73 loc) · 2.37 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
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
80
81
82
83
84
85
86
# https://taskfile.dev
version: '3'
includes:
example: { taskfile: _example/Taskfile.yml }
bench: { taskfile: bench.taskfile.yml }
env:
GO_MODULE: github.com/Semior001/groxy
tasks:
install:
desc: "builds and install local groxy version"
cmd: |
GROXY_VERSION=$(git describe --tags --long)
go install -ldflags "-X 'main.version=$GROXY_VERSION-local' -s -w" ./cmd/...
check:
desc: "run all CI/CD checks"
deps:
- test
- lint
run:
desc: "run application from local source"
cmd: |
go run -ldflags "-X 'main.version=local'" ./cmd/groxy {{.CLI_ARGS}}
lint:
desc: "lint"
cmd: |
go tool -modfile=tools/golangci-lint/go.mod \
golangci-lint run \
--timeout 5m \
--issues-exit-code 1 \
--config .golangci.yml ./...
test:
desc: "run tests"
cmd: |
go test -race -count=1 ./...
gen:
desc: "generate all"
deps:
- gen:jsonschema
- gen:example
- gen:annotation
- gen:testdata
gen:jsonschema:
desc: "generate jsonschema"
cmd: |
go run ./cmd/jsonschemagen \
--title "gRoxy Configuration Schema" \
--description "JSON schema for gRoxy proxy configuration files" \
--schema-version "https://json-schema.org/draft/2020-12/schema" \
--id "https://raw.githubusercontent.com/Semior001/groxy/refs/heads/master/schema.json" \
--output schema.json \
{{.CLI_ARGS}}
gen:annotation:
desc: "generate annotation"
cmd: |
protoc --go_out=./groxypb --go_opt=module=$GO_MODULE/groxypb ./groxypb/*.proto
gen:example:
desc: "generate example"
cmd: |
protoc \
--go_out=./_example/gen --go_opt=module=$GO_MODULE/_example/gen \
--go-grpc_out=./_example/gen --go-grpc_opt=module=$GO_MODULE/_example/gen \
./_example/*.proto
gen:testdata:
desc: "generate testdata"
cmd: |
protoc \
--go_out=./pkg/protodef/testdata --go_opt=module=$GO_MODULE/pkg/protodef/testdata \
--go-grpc_out=./pkg/protodef/testdata --go-grpc_opt=module=$GO_MODULE/pkg/protodef/testdata \
./pkg/protodef/testdata/*.gen.proto
protoc \
--go_out=./pkg/grpcx/grpctest --go_opt=module=$GO_MODULE/pkg/grpcx/grpctest \
--go-grpc_out=./pkg/grpcx/grpctest --go-grpc_opt=module=$GO_MODULE/pkg/grpcx/grpctest \
./pkg/grpcx/grpctest/*.proto