-
-
Notifications
You must be signed in to change notification settings - Fork 57
Expand file tree
/
Copy path.mise.toml
More file actions
158 lines (136 loc) · 4.74 KB
/
.mise.toml
File metadata and controls
158 lines (136 loc) · 4.74 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
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
[env]
OTEL_EXPORTER_OTLP_TRACES_ENDPOINT = "http://127.0.0.1:4317"
OTEL_EXPORTER_OTLP_TRACES_PROTOCOL = "grpc"
OTEL_TRACES_SAMPLER = "always_on"
# RUST_LOG = "warn,otel::setup=debug"
# [settings]
# auto_install_disable_tools = [
# "cargo:cargo-deny",
# "cargo:cargo-hack",
# "cargo:cargo-insta",
# "cargo:cargo-nextest",
# "cargo:cargo-release",
# "git-cliff",
# ]
[tools]
rust = { version = "1.91.0", profile = "minimal", components = "rustfmt,clippy" } # the rust tool stack (with cargo, fmt, clippy) to build source
grpcurl = "1.9"
protoc = "34.0"
# grpc-health-probe = "*"
# sccache = "0.5"
# cargo-binstall allow to download (insteal of build) "cargo:*"
# - do not use cargo-binstall" (it's a special name used by mise)
# - "aqua:cargo-bins/cargo-binstall" allow to download the binary
"aqua:cargo-bins/cargo-binstall" = "1"
"cargo:cargo-deny" = "latest"
"cargo:cargo-nextest" = "latest"
"cargo:cargo-insta" = "latest"
"cargo:cargo-release" = "latest"
"cargo:cargo-hack" = "latest"
"git-cliff" = "latest"
[tasks.autofix]
description = "Automatically fix some linting issues & format code"
depends_post = ["format"]
run = "cargo clippy --all-features --fix --allow-dirty"
[tasks.format]
alias = "fmt"
description = "Format the code and sort dependencies"
run = [
"cargo fmt",
# "cargo sort --workspace --grouped"
]
[tasks.deny]
description = "Run cargo deny checks"
run = "cargo deny check"
[tasks.check]
description = "Check code with all feature combinations"
run = "cargo hack check --each-feature --no-dev-deps"
wait_for = ["test", "lint"]
[tasks.lint]
description = "Lint the rust code"
run = [
"cargo fmt --all -- --check",
"cargo clippy --workspace --all-features --all-targets -- --deny warnings --allow deprecated --allow unknown-lints",
]
wait_for = ["deny"]
[tasks.megalinter]
description = "Run megalinter in container"
run = 'docker run --pull always --rm -it -v "$PWD:/tmp/lint:rw" "oxsecurity/megalinter-documentation:v8"'
[tasks.test]
description = "Launch tests"
run = [
"cargo nextest run",
"cargo test --doc",
]
wait_for = ["lint"]
[tasks."test:review"]
description = "Launch snapshot test and review result (accept or reject)"
run = [
"cargo insta review",
]
wait_for = ["lint"]
[tasks.test-each-feature]
description = "Test each feature separately"
run = "cargo hack test --each-feature -- --test-threads=1"
[tasks.set-version]
description = "Set version across all workspace crates (Usage: mise run set-version <version>)"
run = '''
#!/usr/bin/env bash
version="{{arg(name="version")}}"
sed -i "s/^version = .*/version = \"$version\"/" Cargo.toml
release-plz set-version axum-tracing-opentelemetry@"$version"
release-plz set-version fake-opentelemetry-collector@"$version"
release-plz set-version init-tracing-opentelemetry@"$version"
# release-plz set-version testing-tracing-opentelemetry@"$version"
release-plz set-version tonic-tracing-opentelemetry@"$version"
release-plz set-version tracing-opentelemetry-instrumentation-sdk@"$version"
'''
[tasks.run-otel-desktop-viewer]
description = "Run otel-desktop-viewer as receiver and viewer of otel trace"
run = [
"# Viewer: open http://localhost:8000",
"docker run -p 8000:8000 -p 4317:4317 -p 4318:4318 ghcr.io/ctrlspice/otel-desktop-viewer:latest-amd64",
]
[tasks.run-jaeger]
description = "Run Jaeger all-in-one container"
run = [
"# Viewer: open http://localhost:16686",
'''
docker run --rm --name jaeger \
-p 16686:16686 \
-p 4317:4317 \
-p 4318:4318 \
-p 5778:5778 \
-p 9411:9411 \
cr.jaegertracing.io/jaegertracing/jaeger:latest
'''
]
[tasks.run-example-grpc-server]
description = "Run gRPC server example"
run = "cd examples/grpc && OTEL_SERVICE_NAME=grpc-server cargo run --bin server"
[tasks.run-example-grpc-client]
description = "Run gRPC client example"
run = '''
grpcurl -plaintext 127.0.0.1:50051 list
cd examples/grpc && OTEL_SERVICE_NAME=grpc-client cargo run --bin client
'''
[tasks.run-example-axum-otlp-server]
description = "Run axum-otlp server example"
run = "cd examples/axum-otlp && OTEL_SERVICE_NAME=axum-otlp-4317 cargo run"
[tasks.run-example-axum-otlp-server-http]
description = "Run axum-otlp server example over HTTP"
run = 'cd examples/axum-otlp && OTEL_EXPORTER_OTLP_TRACES_ENDPOINT="http://localhost:4318/v1/traces" OTEL_SERVICE_NAME=axum-otlp-4318 cargo run --features otlp-over-http'
[tasks.run-example-http-server]
description = "Run HTTP server example (alias for axum-otlp)"
depends = ["run-example-axum-otlp-server"]
[tasks.run-example-http-client]
description = "Run HTTP client example"
run = '''
# curl -i http://127.0.0.1:3003/health
curl -i http://127.0.0.1:3003/
'''
[tasks.run-example-load]
description = "Run load test example"
run = "cd examples/load && cargo run --release 2>/dev/null"
[tasks.ci]
depends = ["check", "lint", "test", "deny"]