diff --git a/.github/workflows/rust.yml b/.github/workflows/rust.yml index c2fdddcbed6e4..5658ee8935fdd 100644 --- a/.github/workflows/rust.yml +++ b/.github/workflows/rust.yml @@ -93,7 +93,7 @@ jobs: - uses: taiki-e/install-action@nextest - name: cargo simtest run: | - scripts/simtest/cargo-simtest simtest + scripts/simtest/cargo-simtest simtest build # This is a no-op job that allows the resulting action names to line up when # there are no rust changes in a given PR/commit. This ensures that we can diff --git a/scripts/simtest/cargo-simtest b/scripts/simtest/cargo-simtest index 1bb557da675be..cf5443203bb44 100755 --- a/scripts/simtest/cargo-simtest +++ b/scripts/simtest/cargo-simtest @@ -43,8 +43,13 @@ else echo "Using MSIM_TEST_SEED=$MSIM_TEST_SEED from the environment" fi -cargo nextest run \ - --cargo-profile simulator \ +CARGO_COMMAND=(nextest run --cargo-profile simulator) +if [ "$1" = "build" ]; then + shift + CARGO_COMMAND=(build --profile simulator) +fi + +cargo ${CARGO_COMMAND[@]} \ --config 'build.rustflags = ["--cfg", "msim"]' \ --config 'patch.crates-io.tokio.git = "https://github.com/MystenLabs/mysten-sim.git"' \ --config 'patch.crates-io.tokio.rev = "15dff80e8e69218bc20b08a5ef91a4f156e626ac"' \