Skip to content

Commit 63efded

Browse files
ci: improve workflows
1 parent 83109e8 commit 63efded

18 files changed

Lines changed: 107 additions & 58 deletions

File tree

.github/workflows/ci.yml

Lines changed: 17 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -27,12 +27,26 @@ 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
34-
run: cargo clippy --all-features --locked
37+
run: cargo clippy --locked
38+
39+
- name: Check dependencies
40+
run: cargo deny check
3541

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
3650
test:
3751
name: Test
3852
runs-on: ubuntu-latest
@@ -42,7 +56,6 @@ jobs:
4256
uses: actions/checkout@v5
4357

4458
# TODO: Investigate why tests fail on stable toolchain.
45-
4659
- name: Set up Rust toolchain
4760
uses: actions-rust-lang/setup-rust-toolchain@v1
4861
with:

.github/workflows/release.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,6 @@ jobs:
3434
- name: Set up Rust toolchain
3535
uses: actions-rust-lang/setup-rust-toolchain@v1
3636
with:
37-
components: clippy, rustfmt
3837
target: wasm32-unknown-unknown
3938

4039
- name: Install Cargo Binary Install

.github/workflows/upstream.yml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,6 @@ jobs:
2020

2121
- name: Set up Rust toolchain
2222
uses: actions-rust-lang/setup-rust-toolchain@v1
23-
with:
24-
components: clippy, rustfmt
2523

2624
- name: Check for upstream releases
2725
run: cargo run -p scripts --bin upstream

.github/workflows/website.yml

Lines changed: 0 additions & 2 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

.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/doublify/pre-commit-rust
3-
rev: v1.0
4-
hooks:
5-
- id: fmt
6-
- id: clippy
7-
82
- repo: https://github.com/pre-commit/mirrors-prettier
93
rev: v3.1.0
104
hooks:
115
- id: prettier
126
language: node
137
additional_dependencies:
14-
- prettier@^3.3.3
8+
- prettier@^3.6.2
159
- prettier-plugin-tailwindcss@^0.6.6
10+
11+
- repo: https://github.com/doublify/pre-commit-rust
12+
rev: v1.0
13+
hooks:
14+
- id: fmt
15+
- id: clippy
16+
17+
- repo: https://github.com/EmbarkStudios/cargo-deny
18+
rev: 0.18.4
19+
hooks:
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']

Cargo.lock

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

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,8 @@ floating-ui-leptos = { path = "./packages/leptos", version = "0.5.0" }
2929
floating-ui-utils = { path = "./packages/utils", version = "0.5.0" }
3030
floating-ui-yew = { path = "./packages/yew", version = "0.5.0" }
3131
leptos = "0.8.0"
32-
leptos_router = "0.8.0"
3332
leptos-node-ref = "0.2.0"
33+
leptos_router = "0.8.0"
3434
log = "0.4.22"
3535
send_wrapper = "0.6.0"
3636
serde = { version = "1.0.209", features = ["derive"] }

book-examples/Cargo.toml

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

12+
[features]
13+
default = ["arrow", "flip", "placement", "shift", "size", "virtual"]
14+
arrow = []
15+
flip = []
16+
placement = []
17+
shift = []
18+
size = []
19+
virtual = []
20+
1221
[dependencies]
1322
console_error_panic_hook.workspace = true
1423
console_log.workspace = true
@@ -19,12 +28,3 @@ leptos-node-ref.workspace = true
1928
log.workspace = true
2029
send_wrapper.workspace = true
2130
tailwind_fuse = "0.3.1"
22-
23-
[features]
24-
default = ["arrow", "flip", "placement", "shift", "size", "virtual"]
25-
arrow = []
26-
flip = []
27-
placement = []
28-
shift = []
29-
size = []
30-
virtual = []

deny.toml

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
[graph]
2+
all-features = true
3+
4+
[advisories]
5+
ignore = [
6+
{ id = "RUSTSEC-2024-0370", reason = "No safe upgrade is available `proc-macro-error`." },
7+
{ id = "RUSTSEC-2024-0436", reason = "No maintained version available for `paste`." },
8+
]
9+
10+
[bans]
11+
allow-wildcard-paths = true
12+
multiple-versions = "allow"
13+
wildcards = "deny"
14+
15+
[licenses]
16+
allow = [
17+
"Apache-2.0",
18+
"BSD-3-Clause",
19+
"BSL-1.0",
20+
"CC0-1.0",
21+
"ISC",
22+
"MIT",
23+
"Unicode-3.0",
24+
"Zlib",
25+
]
26+
confidence-threshold = 1.0
27+
28+
[sources]
29+
unknown-git = "deny"
30+
unknown-registry = "deny"

packages/core/Cargo.toml

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

12+
[package.metadata.cargo-machete]
13+
ignored = ["dyn_std"]
14+
1215
[dependencies]
1316
dyn_derive.workspace = true
1417
dyn_std.workspace = true

0 commit comments

Comments
 (0)