diff --git a/.github/workflows/rust.yml b/.github/workflows/rust.yml index 60dda31e1c1..1de7d08323b 100644 --- a/.github/workflows/rust.yml +++ b/.github/workflows/rust.yml @@ -1,4 +1,4 @@ -on: [ push, pull_request ] +on: [push, pull_request] name: Rust @@ -7,6 +7,23 @@ env: RUSTDOCFLAGS: -D warnings jobs: + cargo-hack-test: + name: cargo-hack test + runs-on: ubuntu-22.04 + steps: + - uses: actions/checkout@v4 + - uses: dtolnay/rust-toolchain@master + with: + toolchain: 1.76.0 + + - run: sudo apt-get update && sudo apt-get install libgtk-3-dev libatk1.0-dev + + - name: Set up cargo cache + uses: Swatinem/rust-cache@v2 + + - name: Run cargo-hack + run: ./scripts/hack.sh + fmt-crank-check-test: name: Format + check + test runs-on: ubuntu-22.04 diff --git a/scripts/hack.sh b/scripts/hack.sh new file mode 100755 index 00000000000..2c99f2131a3 --- /dev/null +++ b/scripts/hack.sh @@ -0,0 +1,18 @@ +#!/usr/bin/env bash + +set -eu +script_path=$( cd "$(dirname "${BASH_SOURCE[0]}")" ; pwd -P ) +cd "$script_path/.." +#set -x + +export RUSTFLAGS="-D warnings" +cargo +1.76.0 install --quiet cargo-hack +# We maybe should also check "egui-wgpu" and "egui_demo_app" +members=("ecolor" "eframe" "egui" "egui_demo_lib" "egui_extras" "egui_glow" "egui-winit" "emath" "epaint" "epaint_default_fonts") + +for member in "${members[@]}"; do + echo "Checking $member" + cargo hack check --each-feature --no-dev-deps --quiet --clean-per-run --manifest-path "crates/${member}/Cargo.toml" +done + +echo "All checks passed!"