# Update for stable
rustup update --no-self-update stable
# Install for coverage
cargo install cargo-tarpaulin
# Install for lint
cargo install cargo-hack --debug
rustup component add clippy
rustup component add rustfmt
# Install for upx
sudo apt update -y
sudo apt install -y upx
# Install for Windows
# rustc --print target-list
sudo apt update -y
sudo apt install -y mingw-w64
rustup target add x86_64-pc-windows-gnu
rustup toolchain install stable-x86_64-pc-windows-gnu
# Install for Linux
# rustc --print target-list
rustup target add x86_64-unknown-linux-musl
rustup toolchain install stable-x86_64-unknown-linux-musl
cd hello-rust
cargo check --release --all-features --all-targets
cd hello-rust
# Build target for Windows
cargo build --release --all-features --all-targets --target x86_64-pc-windows-gnu
upx target/x86_64-pc-windows-gnu/release/hello-rust.exe
# Build target for Linux
cargo build --release --all-features --all-targets --target=x86_64-unknown-linux-musl
upx target/x86_64-unknown-linux-musl/release/hello-rust
cd hello-rust
# rustup update --no-self-update stable
# rustup component add rustfmt
cargo fmt --all
# rustup update --no-self-update stable
# rustup component add clippy
cargo clippy --all-features --all-targets -- -A clippy::all
# rustup update --no-self-update stable
# cargo install cargo-hack --debug
cargo hack check --all-features --all-targets
cd hello-rust
# rustup update --no-self-update stable
cargo test --all-features --all-targets -- --nocapture
cd hello-rust
rm -rf target