Skip to content
This repository was archived by the owner on Feb 2, 2026. It is now read-only.

Commit 3618146

Browse files
ci: improve workflows (#590)
1 parent 4e1f6e0 commit 3618146

25 files changed

Lines changed: 175 additions & 112 deletions

File tree

.github/workflows/ci.yml

Lines changed: 36 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -9,14 +9,14 @@ on:
99
permissions:
1010
contents: read
1111

12-
env:
13-
RUSTFLAGS: '-Dwarnings'
14-
1512
jobs:
16-
test:
17-
name: Test
13+
lint:
14+
name: Lint
1815
runs-on: ubuntu-latest
1916

17+
env:
18+
RUSTFLAGS: '-Dwarnings'
19+
2020
steps:
2121
- name: Checkout
2222
uses: actions/checkout@v5
@@ -27,11 +27,40 @@ jobs:
2727
components: clippy, rustfmt
2828
target: wasm32-unknown-unknown
2929

30-
- name: Check formatting
31-
run: cargo fmt --all --check
30+
- name: Install Cargo Binary Install
31+
uses: cargo-bins/cargo-binstall@main
32+
33+
- name: Install crates
34+
run: cargo binstall -y --force cargo-deny cargo-machete cargo-sort
3235

3336
- name: Lint
3437
run: cargo clippy --all-features --locked
3538

39+
- name: Check dependencies
40+
run: cargo deny check
41+
42+
- name: Check unused dependencies
43+
run: cargo machete
44+
45+
- name: Check manifest formatting
46+
run: cargo sort --workspace --check
47+
48+
- name: Check formatting
49+
run: cargo fmt --all --check
50+
51+
test:
52+
name: Test
53+
runs-on: ubuntu-latest
54+
55+
steps:
56+
- name: Checkout
57+
uses: actions/checkout@v5
58+
59+
- name: Set up Rust toolchain
60+
uses: actions-rust-lang/setup-rust-toolchain@v1
61+
with:
62+
components: clippy, rustfmt
63+
target: wasm32-unknown-unknown
64+
3665
- name: Test
3766
run: cargo test --all-features --locked --release

.github/workflows/website.yml

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@ jobs:
2323
- name: Set up Rust toolchain
2424
uses: actions-rust-lang/setup-rust-toolchain@v1
2525
with:
26-
components: clippy, rustfmt
2726
target: wasm32-unknown-unknown
2827

2928
- name: Install Cargo Binary Install
@@ -49,7 +48,6 @@ jobs:
4948
- name: Set up Rust toolchain
5049
uses: actions-rust-lang/setup-rust-toolchain@v1
5150
with:
52-
components: clippy, rustfmt
5351
target: wasm32-unknown-unknown
5452

5553
- name: Install Cargo Binary Install
@@ -59,7 +57,7 @@ jobs:
5957
run: cargo binstall --force -y mdbook mdbook-tabs mdbook-trunk trunk
6058

6159
- name: Install Node.js dependencies
62-
run: npm install
60+
run: npm ci
6361

6462
- name: Build Book
6563
run: mdbook build

.pre-commit-config.yaml

Lines changed: 32 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,40 @@
11
repos:
2+
- repo: https://github.com/pre-commit/mirrors-prettier
3+
rev: v3.1.0
4+
hooks:
5+
- id: prettier
6+
language: node
7+
additional_dependencies:
8+
- prettier@^3.6.2
9+
- prettier-plugin-tailwindcss@^0.6.6
10+
211
- repo: https://github.com/doublify/pre-commit-rust
312
rev: v1.0
413
hooks:
514
- id: fmt
615
- id: clippy
716

8-
- repo: https://github.com/pre-commit/mirrors-prettier
9-
rev: v3.1.0
17+
- repo: https://github.com/EmbarkStudios/cargo-deny
18+
rev: 0.18.4
1019
hooks:
11-
- id: prettier
12-
language: node
13-
additional_dependencies:
14-
- prettier@^3.2.5
15-
- prettier-plugin-tailwindcss@^0.6.0
20+
- id: cargo-deny
21+
22+
# - repo: https://github.com/bnjbvr/cargo-machete
23+
# rev: ba1bcd4
24+
# hooks:
25+
# - id: cargo-machete
26+
- repo: local
27+
hooks:
28+
- id: cargo-machete
29+
name: cargo-machete
30+
language: rust
31+
entry: cargo machete
32+
types: [file, toml]
33+
files: Cargo\.(toml|lock)
34+
pass_filenames: false
35+
36+
- repo: https://github.com/DevinR528/cargo-sort
37+
rev: v2.0.1
38+
hooks:
39+
- id: cargo-sort
40+
args: ['--workspace']

.prettierrc.json

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,5 @@
33
"bracketSpacing": false,
44
"printWidth": 120,
55
"singleQuote": true,
6-
"tabWidth": 4,
7-
"trailingComma": "none"
6+
"tabWidth": 4
87
}

Cargo.lock

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

Cargo.toml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -49,12 +49,12 @@ console_error_panic_hook = "0.1.7"
4949
console_log = "1.0.0"
5050
dioxus = "0.6.1"
5151
leptos = "0.8.0"
52-
leptos_dom = "0.8.0"
53-
leptos_router = "0.8.0"
5452
leptos-maybe-callback = "0.2.0"
5553
leptos-node-ref = "0.2.0"
5654
leptos-style = "0.2.0"
5755
leptos-typed-fallback-show = "0.2.0"
56+
leptos_dom = "0.8.0"
57+
leptos_router = "0.8.0"
5858
log = "0.4.22"
5959
radix-dioxus-icons = { path = "./packages/icons/dioxus", version = "0.0.2" }
6060
radix-leptos-accessible-icon = { path = "./packages/primitives/leptos/accessible-icon", version = "0.0.2" }
@@ -75,10 +75,10 @@ radix-leptos-portal = { path = "./packages/primitives/leptos/portal", version =
7575
radix-leptos-primitive = { path = "./packages/primitives/leptos/primitive", version = "0.0.2" }
7676
# radix-leptos-roving-focus = { path = "./packages/primitives/leptos/roving-focus", version = "0.0.2" }
7777
radix-leptos-separator = { path = "./packages/primitives/leptos/separator", version = "0.0.2" }
78-
radix-leptos-visually-hidden = { path = "./packages/primitives/leptos/visually-hidden", version = "0.0.2" }
7978
radix-leptos-use-controllable-state = { path = "./packages/primitives/leptos/use-controllable-state", version = "0.0.2" }
8079
radix-leptos-use-previous = { path = "./packages/primitives/leptos/use-previous", version = "0.0.2" }
8180
radix-leptos-use-size = { path = "./packages/primitives/leptos/use-size", version = "0.0.2" }
81+
radix-leptos-visually-hidden = { path = "./packages/primitives/leptos/visually-hidden", version = "0.0.2" }
8282
radix-number = { path = "./packages/primitives/core/number", version = "0.0.2" }
8383
radix-yew-arrow = { path = "./packages/primitives/yew/arrow", version = "0.0.2" }
8484
radix-yew-aspect-ratio = { path = "./packages/primitives/yew/aspect-ratio", version = "0.0.2" }
@@ -87,8 +87,8 @@ radix-yew-checkbox = { path = "./packages/primitives/yew/checkbox", version = "0
8787
radix-yew-collection = { path = "./packages/primitives/yew/collection", version = "0.0.2" }
8888
radix-yew-compose-refs = { path = "./packages/primitives/yew/compose-refs", version = "0.0.2" }
8989
radix-yew-dialog = { path = "./packages/primitives/yew/dialog", version = "0.0.2" }
90-
radix-yew-dismissable-layer = { path = "./packages/primitives/yew/dismissable-layer", version = "0.0.2" }
9190
radix-yew-direction = { path = "./packages/primitives/yew/direction", version = "0.0.2" }
91+
radix-yew-dismissable-layer = { path = "./packages/primitives/yew/dismissable-layer", version = "0.0.2" }
9292
radix-yew-focus-guards = { path = "./packages/primitives/yew/focus-guards", version = "0.0.2" }
9393
radix-yew-focus-scope = { path = "./packages/primitives/yew/focus-scope", version = "0.0.2" }
9494
radix-yew-icons = { path = "./packages/icons/yew", version = "0.0.2" }
@@ -105,10 +105,10 @@ radix-yew-separator = { path = "./packages/primitives/yew/separator", version =
105105
radix-yew-switch = { path = "./packages/primitives/yew/switch", version = "0.0.2" }
106106
radix-yew-themes = { path = "./packages/themes/yew", version = "0.0.2" }
107107
radix-yew-tooltip = { path = "./packages/primitives/yew/tooltip", version = "0.0.2" }
108-
radix-yew-visually-hidden = { path = "./packages/primitives/yew/visually-hidden", version = "0.0.2" }
109108
radix-yew-use-controllable-state = { path = "./packages/primitives/yew/use-controllable-state", version = "0.0.2" }
110109
radix-yew-use-previous = { path = "./packages/primitives/yew/use-previous", version = "0.0.2" }
111110
radix-yew-use-size = { path = "./packages/primitives/yew/use-size", version = "0.0.2" }
111+
radix-yew-visually-hidden = { path = "./packages/primitives/yew/visually-hidden", version = "0.0.2" }
112112
send_wrapper = "0.6.0"
113113
serde = "1.0.198"
114114
serde_json = "1.0.116"

book-examples/dioxus/icons/Cargo.toml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,13 +9,13 @@ license.workspace = true
99
repository.workspace = true
1010
version.workspace = true
1111

12+
[features]
13+
default = []
14+
icons = ["dep:radix-dioxus-icons"]
15+
1216
[dependencies]
1317
console_error_panic_hook.workspace = true
1418
console_log.workspace = true
19+
dioxus = { workspace = true, features = ["web"] }
1520
log.workspace = true
1621
radix-dioxus-icons = { workspace = true, optional = true }
17-
dioxus = { workspace = true, features = ["web"] }
18-
19-
[features]
20-
default = []
21-
icons = ["dep:radix-dioxus-icons"]

book-examples/dioxus/primitives/Cargo.toml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,11 @@ license.workspace = true
99
repository.workspace = true
1010
version.workspace = true
1111

12+
[features]
13+
default = []
14+
1215
[dependencies]
1316
console_error_panic_hook.workspace = true
1417
console_log.workspace = true
15-
log.workspace = true
1618
dioxus = { workspace = true, features = ["web"] }
17-
18-
[features]
19-
default = []
19+
log.workspace = true

book-examples/leptos/icons/Cargo.toml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,13 +9,13 @@ license.workspace = true
99
repository.workspace = true
1010
version.workspace = true
1111

12+
[features]
13+
default = []
14+
icons = ["dep:radix-leptos-icons"]
15+
1216
[dependencies]
1317
console_error_panic_hook.workspace = true
1418
console_log.workspace = true
1519
leptos = { workspace = true, features = ["csr"] }
1620
log.workspace = true
1721
radix-leptos-icons = { workspace = true, optional = true }
18-
19-
[features]
20-
default = []
21-
icons = ["dep:radix-leptos-icons"]

book-examples/leptos/primitives/Cargo.toml

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -8,19 +8,6 @@ edition.workspace = true
88
license.workspace = true
99
repository.workspace = true
1010
version.workspace = true
11-
12-
[dependencies]
13-
console_error_panic_hook.workspace = true
14-
console_log.workspace = true
15-
leptos = { workspace = true, features = ["csr"] }
16-
log.workspace = true
17-
radix-leptos-aspect-ratio = { workspace = true, optional = true }
18-
# radix-leptos-avatar = { workspace = true, optional = true }
19-
# radix-leptos-checkbox = { workspace = true, optional = true }
20-
# radix-leptos-icons = { workspace = true, optional = true }
21-
radix-leptos-label = { workspace = true, optional = true }
22-
# radix-leptos-progress = { workspace = true, optional = true }
23-
radix-leptos-separator = { workspace = true, optional = true }
2411
# radix-leptos-switch = { workspace = true, optional = true }
2512
# radix-leptos-toggle = { workspace = true, optional = true }
2613

@@ -43,6 +30,19 @@ progress = []
4330
separator = ["dep:radix-leptos-separator"]
4431
switch = []
4532
toggle = []
33+
34+
[dependencies]
35+
console_error_panic_hook.workspace = true
36+
console_log.workspace = true
37+
leptos = { workspace = true, features = ["csr"] }
38+
log.workspace = true
39+
radix-leptos-aspect-ratio = { workspace = true, optional = true }
40+
# radix-leptos-avatar = { workspace = true, optional = true }
41+
# radix-leptos-checkbox = { workspace = true, optional = true }
42+
# radix-leptos-icons = { workspace = true, optional = true }
43+
radix-leptos-label = { workspace = true, optional = true }
44+
# radix-leptos-progress = { workspace = true, optional = true }
45+
radix-leptos-separator = { workspace = true, optional = true }
4646
# avatar = ["dep:radix-leptos-avatar"]
4747
# checkbox = ["dep:radix-leptos-checkbox", "dep:radix-leptos-icons"]
4848
# progress = ["dep:radix-leptos-progress"]

0 commit comments

Comments
 (0)