Skip to content

Commit f9a8799

Browse files
committed
feat: Trim rust dependency
1 parent 2e8f15a commit f9a8799

13 files changed

Lines changed: 63 additions & 127 deletions

File tree

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
name: 🦀 Rust dependency machete
2+
3+
on:
4+
push:
5+
paths:
6+
- "**/*.rs"
7+
- "**/Cargo.toml"
8+
- "**/Cargo.lock"
9+
- ".github/workflows/back-cargo-machete.yaml"
10+
pull_request:
11+
branches: ["main"]
12+
paths:
13+
- "**/*.rs"
14+
- "**/Cargo.toml"
15+
- "**/Cargo.lock"
16+
- ".github/workflows/back-cargo-machete.yaml"
17+
workflow_dispatch:
18+
19+
permissions:
20+
contents: read
21+
22+
jobs:
23+
cargo-machete:
24+
name: Check for unused Rust dependencies
25+
runs-on: ubuntu-latest
26+
steps:
27+
- name: Checkout repository
28+
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
29+
30+
- name: Install Rust toolchain
31+
uses: dtolnay/rust-toolchain@4be9e76fd7c4901c61fb841f559994984270fce7 # stable
32+
with:
33+
toolchain: stable
34+
35+
- name: Machete
36+
uses: bnjbvr/cargo-machete@7959c845782fed02ee69303126d4a12d64f1db18 # v0.9.1

Cargo.lock

Lines changed: 2 additions & 82 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Taskfile.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ tasks:
1818
silent: true
1919
cmds:
2020
- echo "Initializing the project"
21-
- cargo install cargo-set-version
21+
- cargo install cargo-set-version cargo-machete
2222
- yarn install
2323
- cd .docs && yarn install
2424
- cog install-hook -a -o

apps/crdgen/Cargo.toml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,7 @@ edition = "2021"
66

77
[dependencies]
88
kube = { workspace = true }
9-
crd = { path = "../../libs/server/crd" , version = "0.1.9" }
10-
serde = { workspace = true }
9+
crd = { path = "../../libs/server/crd", version = "0.1.9" }
1110
serde_yaml = { workspace = true }
1211

1312
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

apps/server/Cargo.toml

Lines changed: 4 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -9,27 +9,18 @@ actix-web = { workspace = true }
99
tokio = { workspace = true }
1010
anyhow = { workspace = true }
1111
utoipa = { workspace = true }
12-
tracing = { workspace = true }
13-
uuid = { workspace = true }
14-
kube = { workspace = true }
15-
reqwest = { workspace = true }
1612
rustls = { workspace = true }
1713

1814
utoipa-actix-web = { workspace = true }
1915

20-
opentelemetry = { workspace = true }
21-
opentelemetry_sdk = { workspace = true }
22-
opentelemetry-otlp = { workspace = true }
23-
opentelemetry-appender-tracing = { workspace = true }
24-
tracing-subscriber = { workspace = true }
2516

2617
utoipa-scalar = { version = "0.3", features = ["actix-web"] }
2718
actix-cors = { version = "0.7" }
2819
tracing-actix-web = { version = "0.7", features = ["opentelemetry_0_31"] }
2920

30-
api = { path = "../../libs/server/api" , version = "0.1.9" }
31-
trace = { path = "../../libs/server/trace" , version = "0.1.9" }
32-
common = { path = "../../libs/server/common" , version = "0.1.9" }
33-
controller = { path = "../../libs/server/controller" , version = "0.1.9" }
21+
api = { path = "../../libs/server/api", version = "0.1.9" }
22+
trace = { path = "../../libs/server/trace", version = "0.1.9" }
23+
common = { path = "../../libs/server/common", version = "0.1.9" }
24+
controller = { path = "../../libs/server/controller", version = "0.1.9" }
3425

3526
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

apps/swaggergen/Cargo.toml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,7 @@ edition = "2021"
55

66

77
[dependencies]
8-
utoipa = { workspace = true }
9-
api = { path = "../../libs/server/api" , version = "0.1.9" }
8+
api = { path = "../../libs/server/api", version = "0.1.9" }
109

1110

1211
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

libs/cli/cli/Cargo.toml

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,9 @@ edition = "2021"
77
clap = { version = "4.5", features = ["derive"] }
88

99
tracing = { workspace = true }
10-
k8s-openapi = { workspace = true }
1110
kube = { workspace = true }
11+
k8s-openapi = { workspace = true }
1212
thiserror = { workspace = true }
13-
tokio = { workspace = true }
1413
serde = { workspace = true }
1514
serde_yaml = { workspace = true }
1615
serde_json = { workspace = true }
@@ -22,7 +21,10 @@ keyring = { version = "3", features = [
2221
"sync-secret-service",
2322
] }
2423

25-
cli_trace = { path = "../cli_trace" , version = "0.1.9" }
26-
client_api = { path = "../client_api" , version = "0.1.9" }
24+
cli_trace = { path = "../cli_trace", version = "0.1.9" }
25+
client_api = { path = "../client_api", version = "0.1.9" }
2726
comfy-table = "7.2"
2827
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
28+
29+
[package.metadata.cargo-machete]
30+
ignored = ["k8s-openapi"]

libs/cli/cli_trace/Cargo.toml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ version = "0.1.9"
44
edition = "2021"
55

66
[dependencies]
7-
tokio = { workspace = true }
87
tracing = { workspace = true }
98
serde = { workspace = true }
109
serde_repr = "0.1"
@@ -17,6 +16,7 @@ tracing-subscriber = { workspace = true, features = [
1716
"time",
1817
] }
1918

20-
tracing-bunyan-formatter = "0.3"
21-
2219
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
20+
21+
[package.metadata.cargo-machete]
22+
ignored = ["serde"]

libs/server/api/Cargo.toml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,12 +17,10 @@ tokio = { workspace = true }
1717
tokio-stream = { workspace = true }
1818
futures-util = { workspace = true }
1919
openidconnect = { workspace = true }
20-
oauth2-reqwest = { workspace = true }
2120
thiserror = { workspace = true }
2221
serde_json = { workspace = true }
2322
rustls = { workspace = true }
2423
rustls-platform-verifier = { workspace = true }
25-
rustls-pki-types = { workspace = true }
2624
tokio-rustls = { workspace = true }
2725

2826
common = { path = "../common", version = "0.1.9" }

libs/server/common/Cargo.toml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,3 +16,5 @@ k8s-openapi = { workspace = true }
1616
oauth2-reqwest = { workspace = true }
1717

1818
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
19+
[package.metadata.cargo-machete]
20+
ignored = ["k8s-openapi"]

0 commit comments

Comments
 (0)