2022-04-07 15:34:34 +00:00
|
|
|
#!/usr/bin/env bash
|
2022-08-27 07:54:47 +00:00
|
|
|
# This scripts runs various CI-like checks in a convenient way.
|
|
|
|
|
|
|
|
set -eu
|
2021-05-09 11:28:24 +00:00
|
|
|
script_path=$( cd "$(dirname "${BASH_SOURCE[0]}")" ; pwd -P )
|
|
|
|
cd "$script_path/.."
|
2022-08-27 07:54:47 +00:00
|
|
|
set -x
|
2020-10-17 09:03:10 +00:00
|
|
|
|
2021-02-21 09:12:08 +00:00
|
|
|
# Checks all tests, lints etc.
|
|
|
|
# Basically does what the CI does.
|
|
|
|
|
2022-07-20 10:34:19 +00:00
|
|
|
cargo install cargo-cranky # Uses lints defined in Cranky.toml. See https://github.com/ericseppanen/cargo-cranky
|
|
|
|
|
2022-08-28 08:58:58 +00:00
|
|
|
# web_sys_unstable_apis is required to enable the web_sys clipboard API which eframe web uses,
|
|
|
|
# as well as by the wasm32-backend of the wgpu crate.
|
|
|
|
export RUSTFLAGS="--cfg=web_sys_unstable_apis -D warnings"
|
2022-08-27 07:54:47 +00:00
|
|
|
export RUSTDOCFLAGS="-D warnings" # https://github.com/emilk/egui/pull/1454
|
2022-04-05 06:07:57 +00:00
|
|
|
|
2022-08-27 07:54:47 +00:00
|
|
|
cargo check --all-targets
|
|
|
|
cargo check --all-targets --all-features
|
2021-01-04 00:44:02 +00:00
|
|
|
cargo check -p egui_demo_app --lib --target wasm32-unknown-unknown
|
|
|
|
cargo check -p egui_demo_app --lib --target wasm32-unknown-unknown --all-features
|
2022-08-27 07:54:47 +00:00
|
|
|
cargo cranky --all-targets --all-features -- -D warnings
|
|
|
|
cargo test --all-targets --all-features
|
|
|
|
cargo test --doc # slow - checks all doc-tests
|
2021-02-21 09:12:08 +00:00
|
|
|
cargo fmt --all -- --check
|
2020-10-17 09:03:10 +00:00
|
|
|
|
2022-08-27 07:54:47 +00:00
|
|
|
cargo doc --lib --no-deps --all-features
|
2022-01-22 07:56:36 +00:00
|
|
|
cargo doc --document-private-items --no-deps --all-features
|
2021-02-06 23:11:52 +00:00
|
|
|
|
2022-08-20 08:41:49 +00:00
|
|
|
(cd crates/eframe && cargo check --no-default-features --features "glow")
|
|
|
|
(cd crates/eframe && cargo check --no-default-features --features "wgpu")
|
|
|
|
(cd crates/egui && cargo check --no-default-features --features "serde")
|
|
|
|
(cd crates/egui_demo_app && cargo check --no-default-features --features "glow")
|
|
|
|
(cd crates/egui_demo_app && cargo check --no-default-features --features "wgpu")
|
|
|
|
(cd crates/egui_demo_lib && cargo check --no-default-features)
|
|
|
|
(cd crates/egui_extras && cargo check --no-default-features)
|
|
|
|
(cd crates/egui_glium && cargo check --no-default-features)
|
|
|
|
(cd crates/egui_glow && cargo check --no-default-features)
|
2022-08-30 06:49:32 +00:00
|
|
|
(cd crates/egui-winit && cargo check --no-default-features --features "wayland")
|
|
|
|
(cd crates/egui-winit && cargo check --no-default-features --features "winit/x11")
|
2022-08-20 08:41:49 +00:00
|
|
|
(cd crates/emath && cargo check --no-default-features)
|
|
|
|
(cd crates/epaint && cargo check --no-default-features --release)
|
|
|
|
(cd crates/epaint && cargo check --no-default-features)
|
2022-01-31 18:17:49 +00:00
|
|
|
|
2022-08-20 08:41:49 +00:00
|
|
|
(cd crates/eframe && cargo check --all-features)
|
|
|
|
(cd crates/egui && cargo check --all-features)
|
|
|
|
(cd crates/egui_demo_app && cargo check --all-features)
|
|
|
|
(cd crates/egui_extras && cargo check --all-features)
|
|
|
|
(cd crates/egui_glium && cargo check --all-features)
|
|
|
|
(cd crates/egui_glow && cargo check --all-features)
|
|
|
|
(cd crates/egui-winit && cargo check --all-features)
|
|
|
|
(cd crates/emath && cargo check --all-features)
|
|
|
|
(cd crates/epaint && cargo check --all-features)
|
2022-01-31 18:17:49 +00:00
|
|
|
|
2022-02-22 18:32:30 +00:00
|
|
|
./sh/wasm_bindgen_check.sh
|
2022-02-22 15:30:42 +00:00
|
|
|
|
2022-10-30 19:55:07 +00:00
|
|
|
cargo cranky --target wasm32-unknown-unknown --all-features -p egui_demo_app --lib -- -D warnings
|
|
|
|
|
2022-02-04 21:08:15 +00:00
|
|
|
# cargo install cargo-deny
|
2022-02-22 15:30:42 +00:00
|
|
|
cargo deny check
|
2022-01-31 18:17:49 +00:00
|
|
|
|
2022-05-21 14:53:25 +00:00
|
|
|
# TODO(emilk): consider using https://github.com/taiki-e/cargo-hack or https://github.com/frewsxcv/cargo-all-features
|
2022-04-30 13:51:46 +00:00
|
|
|
|
2021-02-21 09:12:08 +00:00
|
|
|
# ------------------------------------------------------------
|
|
|
|
#
|
|
|
|
|
2020-10-17 09:03:10 +00:00
|
|
|
# For finding bloat:
|
2022-07-30 16:39:38 +00:00
|
|
|
# cargo bloat --release --bin egui_demo_app -n 200 | rg egui
|
2022-02-19 19:51:51 +00:00
|
|
|
# Also try https://github.com/google/bloaty
|
2020-10-17 09:03:10 +00:00
|
|
|
|
|
|
|
# what compiles slowly?
|
2022-07-29 14:07:26 +00:00
|
|
|
# cargo clean && time cargo build -p eframe --timings
|
2022-01-16 21:15:49 +00:00
|
|
|
# https://fasterthanli.me/articles/why-is-my-rust-build-so-slow
|
2021-05-09 11:28:24 +00:00
|
|
|
|
|
|
|
# what compiles slowly?
|
|
|
|
# cargo llvm-lines --lib -p egui | head -20
|
2022-04-07 15:03:19 +00:00
|
|
|
|
|
|
|
echo "All checks passed."
|