-
-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathCargo.toml
More file actions
86 lines (81 loc) · 2.82 KB
/
Copy pathCargo.toml
File metadata and controls
86 lines (81 loc) · 2.82 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
[workspace]
resolver = "3"
members = ["uibeam", "uibeam_html", "uibeam_macros"]
[workspace.package]
version = "0.4.0"
edition = "2024"
authors = ["kanarus <kanarus786@gmail.com>"]
homepage = "https://crates.io/uibeam"
repository = "https://github.com/ohkami-rs/uibeam"
readme = "README.md"
license = "MIT"
keywords = ["jsx", "html", "template-engine", "web", "ui"]
categories = ["template-engine", "web-programming", "wasm"]
[workspace.lints.clippy]
duplicated_attributes = "allow" # to keep readability with complex feature combinations
[workspace.lints.rust]
unexpected_cfgs = { level = "warn", check-cfg = ["cfg(hydrate)"] } # for `hydrate` cfg (this can't be realized via feature flag to support wasm32 server environment like Cloudflare Workers)
[workspace.metadata.tasks]
CI = """
cargo metask check test
"""
check = """
cargo metask check_fmt clippy clippy_wasm32 clippy_wasm32_hydrate
"""
check_fmt = """
cargo fmt --all --check
"""
clippy = """
cargo clippy --all-targets -- --deny warnings
cargo clippy --all-targets --no-default-features -- --deny warnings
cargo clippy --all-targets --all-features -- --deny warnings ## `client` + all integrations
"""
clippy_wasm32 = """
export CARGO_BUILD_TARGET='wasm32-unknown-unknown'
cargo clippy --lib -- --deny warnings
cargo clippy --lib --no-default-features -- --deny warnings
"""
clippy_wasm32_hydrate = """
export CARGO_BUILD_TARGET='wasm32-unknown-unknown'
export RUSTFLAGS='--cfg hydrate' ## `hydrate` cfg requires `client` feature
cargo clippy --lib -- --deny warnings
"""
test = """
cargo metask test_crates test_examples
"""
test_crates = """
export RUSTFLAGS='--deny warnings'
cd uibeam
echo "================[doc]================\n"
cargo test --doc --all-features
echo "================[default]================\n"
cargo test --lib
echo "================[with no features]================\n"
cargo test --lib --no-default-features
echo "================[with integrations]================\n"
for integration in $(cargo info --color never uibeam | awk '/\\[.*__integration__.*\\]/ {print $1}'); do
if [ "$integration" != "openapi" ]; then
echo "================[integration:$integration]================\n"
cargo test --lib --features "$integration"
cargo test --lib --features "$integration",openapi
cargo test --lib --no-default-features --features "$integration"
cargo test --lib --no-default-features --features "$integration",openapi
fi
done
"""
test_examples = """
export RUSTFLAGS='--deny warnings'
cd examples
for directory in ./*/; do
if [ "$(basename $directory)" != "target" ]; then
echo "================[example:$(basename $directory)]================\n"
cd "$directory"
cargo test
if [ -f "test.sh" ]; then
chmod +x ./test.sh
./test.sh
fi
cd ..
fi
done
"""