From 4732c1acbb269eeb27e60dca86acc909f2daedc6 Mon Sep 17 00:00:00 2001 From: Joshua Liebow-Feeser Date: Mon, 9 Feb 2026 16:13:04 -0500 Subject: [PATCH 1/3] [ci] Run Miri tests in parallel This should result in below-maximum CPU utilization for less time. It likely won't result in drastic savings, as the test runners are already likely at maximum CPU utilization for most of the run. --- .github/workflows/ci.yml | 56 +++++++++++++++++++++++++++++++++++++--- 1 file changed, 52 insertions(+), 4 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 3ed8893ea6..4f8777bd8f 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -468,16 +468,64 @@ jobs: # Run under both the stacked borrows model (default) and under the tree # borrows model to ensure we're compliant with both. - for EXTRA_FLAGS in "" "-Zmiri-tree-borrows"; do - MIRIFLAGS="$MIRIFLAGS $EXTRA_FLAGS" ./cargo.sh +$TOOLCHAIN \ + + # We run these in the background to allow them to run in parallel. + # + # We need to manually set `CARGO_TARGET_DIR` for each job to avoid + # conflicts since they will be running at the same time. + BASE_TARGET_DIR="target/by-toolchain/${TOOLCHAIN}/miri" + + ( + MIRIFLAGS="$MIRIFLAGS" \ + CARGO_TARGET_DIR="${BASE_TARGET_DIR}-stacked" \ + ./cargo.sh +$TOOLCHAIN \ miri nextest run \ --test-threads "$THREADS" \ --package $CRATE \ --target $TARGET \ - $FEATURES - done + $FEATURES \ + > miri-stacked.log 2>&1 + ) & + PID_STACKED=$! + + ( + MIRIFLAGS="$MIRIFLAGS -Zmiri-tree-borrows" \ + CARGO_TARGET_DIR="${BASE_TARGET_DIR}-tree" \ + ./cargo.sh +$TOOLCHAIN \ + miri nextest run \ + --test-threads "$THREADS" \ + --package $CRATE \ + --target $TARGET \ + $FEATURES \ + > miri-tree.log 2>&1 + ) & + PID_TREE=$! + + # Wait for both jobs to finish. + # We turn off `set -e` so that `wait` doesn't cause the script to exit + # if one of the jobs fails. + set +e + wait $PID_STACKED + CODE_STACKED=$? + wait $PID_TREE + CODE_TREE=$? + set -e + + echo "Output from Stacked Borrows Miri tests:" + cat miri-stacked.log + echo "Output from Tree Borrows Miri tests:" + cat miri-tree.log mv .cargo/config.toml.bak .cargo/config.toml + + if [ $CODE_STACKED -ne 0 ]; then + echo "Stacked Borrows Miri tests failed with exit code $CODE_STACKED" + exit $CODE_STACKED + fi + if [ $CODE_TREE -ne 0 ]; then + echo "Tree Borrows Miri tests failed with exit code $CODE_TREE" + exit $CODE_TREE + fi # Only nightly has a working Miri, so we skip installing on all other # toolchains. # From 8b762346b40b65a3d9c2d00c577950cd75af0cb8 Mon Sep 17 00:00:00 2001 From: Joshua Liebow-Feeser Date: Mon, 9 Feb 2026 16:14:33 -0500 Subject: [PATCH 2/3] Add workflow_dispatch trigger to CI workflow --- .github/workflows/ci.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 4f8777bd8f..be2b729f74 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -11,6 +11,7 @@ name: Build & Tests on: pull_request: merge_group: + workflow_dispatch: permissions: contents: read From 212e0581ddbf4a3359f1b03c6aa4a2d4de913e69 Mon Sep 17 00:00:00 2001 From: Joshua Liebow-Feeser Date: Mon, 9 Feb 2026 16:15:36 -0500 Subject: [PATCH 3/3] Remove workflow_dispatch from CI configuration Remove 'workflow_dispatch' trigger from CI workflow --- .github/workflows/ci.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index be2b729f74..4f8777bd8f 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -11,7 +11,6 @@ name: Build & Tests on: pull_request: merge_group: - workflow_dispatch: permissions: contents: read