From 2f5ed7956a45bfa078fbe997052cb6dd6ddf69c3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fran=C3=A7ois=20Mockers?= Date: Mon, 1 Sep 2025 18:22:08 +0200 Subject: [PATCH 1/7] partition miri tests --- .github/workflows/ci.yml | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 95b8e75ed0bb1..3a1938c0bc112 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -89,6 +89,9 @@ jobs: run: cargo run -p ci -- lints miri: + strategy: + matrix: + partition: [1, 2, 3] runs-on: macos-latest timeout-minutes: 60 steps: @@ -111,10 +114,12 @@ jobs: with: toolchain: ${{ env.NIGHTLY_TOOLCHAIN }} components: miri + - name: Install cargo-nextest + run: curl -LsSf https://get.nexte.st/0.9/linux | tar zxf - -C ${CARGO_HOME:-~/.cargo}/bin - name: CI job # To run the tests one item at a time for troubleshooting, use # cargo --quiet test --lib -- --list | sed 's/: test$//' | MIRIFLAGS="-Zmiri-disable-isolation -Zmiri-disable-weak-memory-emulation" xargs -n1 cargo miri test -p bevy_ecs --lib -- --exact - run: cargo miri test -p bevy_ecs --features bevy_utils/debug + run: cargo miri nextest run -p bevy_ecs --features bevy_utils/debug --partition count:${{ matrix.partition }}/${{ strategy.job-total }} env: # -Zrandomize-layout makes sure we dont rely on the layout of anything that might change RUSTFLAGS: -Zrandomize-layout From 58c9fd00043c38c47b18644712711905f600d413 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fran=C3=A7ois=20Mockers?= Date: Mon, 1 Sep 2025 18:29:36 +0200 Subject: [PATCH 2/7] make it runnable --- .github/workflows/ci.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 3a1938c0bc112..0870455046a07 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -115,7 +115,9 @@ jobs: toolchain: ${{ env.NIGHTLY_TOOLCHAIN }} components: miri - name: Install cargo-nextest - run: curl -LsSf https://get.nexte.st/0.9/linux | tar zxf - -C ${CARGO_HOME:-~/.cargo}/bin + run: | + curl -LsSf https://get.nexte.st/0.9/linux | tar zxf - -C ${CARGO_HOME:-~/.cargo}/bin + chmod 755 ${CARGO_HOME:-~/.cargo}/bin/cargo-nextest - name: CI job # To run the tests one item at a time for troubleshooting, use # cargo --quiet test --lib -- --list | sed 's/: test$//' | MIRIFLAGS="-Zmiri-disable-isolation -Zmiri-disable-weak-memory-emulation" xargs -n1 cargo miri test -p bevy_ecs --lib -- --exact From 0f1d68f826f6cd2c58877dc13d0f5da381538910 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fran=C3=A7ois=20Mockers?= Date: Mon, 1 Sep 2025 18:33:35 +0200 Subject: [PATCH 3/7] :facepalm: --- .github/workflows/ci.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 0870455046a07..9edac7e0809ce 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -116,8 +116,7 @@ jobs: components: miri - name: Install cargo-nextest run: | - curl -LsSf https://get.nexte.st/0.9/linux | tar zxf - -C ${CARGO_HOME:-~/.cargo}/bin - chmod 755 ${CARGO_HOME:-~/.cargo}/bin/cargo-nextest + curl -LsSf https://get.nexte.st/0.9/mac | tar zxf - -C ${CARGO_HOME:-~/.cargo}/bin - name: CI job # To run the tests one item at a time for troubleshooting, use # cargo --quiet test --lib -- --list | sed 's/: test$//' | MIRIFLAGS="-Zmiri-disable-isolation -Zmiri-disable-weak-memory-emulation" xargs -n1 cargo miri test -p bevy_ecs --lib -- --exact From cc2dfd8bf910fd83942ae7614b82c0144dac264d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fran=C3=A7ois=20Mockers?= Date: Mon, 1 Sep 2025 19:56:53 +0200 Subject: [PATCH 4/7] disable parallelism? --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 9edac7e0809ce..f46267b208dfa 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -120,7 +120,7 @@ jobs: - name: CI job # To run the tests one item at a time for troubleshooting, use # cargo --quiet test --lib -- --list | sed 's/: test$//' | MIRIFLAGS="-Zmiri-disable-isolation -Zmiri-disable-weak-memory-emulation" xargs -n1 cargo miri test -p bevy_ecs --lib -- --exact - run: cargo miri nextest run -p bevy_ecs --features bevy_utils/debug --partition count:${{ matrix.partition }}/${{ strategy.job-total }} + run: cargo miri nextest run -p bevy_ecs --features bevy_utils/debug --test-threads=1 --partition count:${{ matrix.partition }}/${{ strategy.job-total }} env: # -Zrandomize-layout makes sure we dont rely on the layout of anything that might change RUSTFLAGS: -Zrandomize-layout From d70480b34d359d6524cc94275243dc677341a3c7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fran=C3=A7ois=20Mockers?= Date: Mon, 1 Sep 2025 20:33:58 +0200 Subject: [PATCH 5/7] whatever --- .github/workflows/ci.yml | 20 ++++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index f46267b208dfa..00dc8729ecab9 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -88,10 +88,26 @@ jobs: # See tools/ci/src/main.rs for the commands this runs run: cargo run -p ci -- lints + miri-partitions: + runs-on: ubuntu-latest + outputs: + partitions: ${{ steps.env.outputs.partitions }} + steps: + - id: env + run: | + count=50 + t="[" + for i in `seq 1 $((count-1))` + do + t="$t$i," + done + echo "partitions=$t$count]" >> $GITHUB_OUTPUT + miri: + needs: [miri-partitions] strategy: matrix: - partition: [1, 2, 3] + partition: ${{ fromJSON(needs.miri-partitions.outputs.partitions) }} runs-on: macos-latest timeout-minutes: 60 steps: @@ -120,7 +136,7 @@ jobs: - name: CI job # To run the tests one item at a time for troubleshooting, use # cargo --quiet test --lib -- --list | sed 's/: test$//' | MIRIFLAGS="-Zmiri-disable-isolation -Zmiri-disable-weak-memory-emulation" xargs -n1 cargo miri test -p bevy_ecs --lib -- --exact - run: cargo miri nextest run -p bevy_ecs --features bevy_utils/debug --test-threads=1 --partition count:${{ matrix.partition }}/${{ strategy.job-total }} + run: cargo miri nextest run -p bevy_ecs --features bevy_utils/debug --partition count:${{ matrix.partition }}/${{ strategy.job-total }} env: # -Zrandomize-layout makes sure we dont rely on the layout of anything that might change RUSTFLAGS: -Zrandomize-layout From 8d82583dc557d7f9264ab663b9cc2378267a9bfe Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fran=C3=A7ois=20Mockers?= Date: Mon, 1 Sep 2025 21:01:11 +0200 Subject: [PATCH 6/7] add a job for branch protection --- .github/workflows/ci.yml | 20 ++++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 00dc8729ecab9..d446f4fda5b4a 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -88,12 +88,13 @@ jobs: # See tools/ci/src/main.rs for the commands this runs run: cargo run -p ci -- lints - miri-partitions: + miri-setup-partitions: runs-on: ubuntu-latest outputs: - partitions: ${{ steps.env.outputs.partitions }} + partitions: ${{ steps.list.outputs.partitions }} steps: - - id: env + - name: Setup partition list + id: list run: | count=50 t="[" @@ -103,11 +104,11 @@ jobs: done echo "partitions=$t$count]" >> $GITHUB_OUTPUT - miri: - needs: [miri-partitions] + miri-run-partitions: + needs: [miri-setup-partitions] strategy: matrix: - partition: ${{ fromJSON(needs.miri-partitions.outputs.partitions) }} + partition: ${{ fromJSON(needs.miri-setup-partitions.outputs.partitions) }} runs-on: macos-latest timeout-minutes: 60 steps: @@ -145,6 +146,13 @@ jobs: # -Zmiri-ignore-leaks is necessary because a bunch of tests don't join all threads before finishing. MIRIFLAGS: -Zmiri-ignore-leaks -Zmiri-disable-isolation + miri: + runs-on: ubuntu-latest + needs: [miri-run-partitions] + if: always() + steps: + - run: ${{ !contains(needs.*.result, 'failure') }} + check-compiles: runs-on: ubuntu-latest timeout-minutes: 30 From de1db0a443e139d69f9a225a903df42066da17af Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fran=C3=A7ois=20Mockers?= Date: Mon, 1 Sep 2025 21:01:19 +0200 Subject: [PATCH 7/7] 20 partitions --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index d446f4fda5b4a..a3bbc748c6ae3 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -96,7 +96,7 @@ jobs: - name: Setup partition list id: list run: | - count=50 + count=20 t="[" for i in `seq 1 $((count-1))` do