File tree Expand file tree Collapse file tree 4 files changed +42
-5
lines changed
crates/rspack_allocator/src Expand file tree Collapse file tree 4 files changed +42
-5
lines changed Original file line number Diff line number Diff line change @@ -21,6 +21,10 @@ inputs:
2121 default : false
2222 required : false
2323 type : boolean
24+ miri :
25+ default : false
26+ required : false
27+ type : boolean
2428 save-cache :
2529 default : false
2630 required : false
5660 shell : bash
5761 run : rustup set profile minimal
5862
63+ - name : Add Miri
64+ shell : bash
65+ if : ${{ inputs.miri == 'true' }}
66+ run : rustup component add miri
67+
5968 - name : Add Clippy
6069 shell : bash
6170 if : ${{ inputs.clippy == 'true' }}
Original file line number Diff line number Diff line change @@ -320,6 +320,35 @@ jobs:
320320 # reason for excluding https://github.com/napi-rs/napi-rs/issues/2200
321321 run : cargo test --workspace --exclude rspack_binding_options --exclude rspack_node -- --nocapture
322322
323+ rust_test_miri :
324+ name : Rust test miri
325+ needs : [get-runner-labels, rust_changes]
326+ if : ${{ needs.rust_changes.outputs.changed == 'true' }}
327+ runs-on : ${{ fromJSON(needs.get-runner-labels.outputs.LINUX_RUNNER_LABELS) }}
328+ steps :
329+ - uses : actions/checkout@v4
330+
331+ - name : Pnpm Cache # Required by some tests
332+ uses : ./.github/actions/pnpm-cache
333+
334+ - name : Install Rust Toolchain
335+ uses : ./.github/actions/rustup
336+ with :
337+ save-cache : ${{ github.ref_name == 'main' }}
338+ shared-key : check
339+ miri : true
340+
341+ # Compile test without debug info for reducing the CI cache size
342+ - name : Change profile.test
343+ shell : bash
344+ run : |
345+ echo '[profile.test]' >> Cargo.toml
346+ echo 'debug = false' >> Cargo.toml
347+
348+ - name : Run test
349+ # reason for excluding https://github.com/napi-rs/napi-rs/issues/2200
350+ run : cargo miri test --workspace --exclude rspack_binding_options --exclude rspack_node -- --nocapture
351+
323352 run_benchmark :
324353 name : Run benchmark
325354 runs-on : ubuntu-latest
Original file line number Diff line number Diff line change 1- use mimalloc:: MiMalloc ;
2-
31#[ global_allocator]
4- static GLOBAL : MiMalloc = MiMalloc ;
2+ #[ cfg( not( miri) ) ]
3+ static GLOBAL : mimalloc:: MiMalloc = mimalloc:: MiMalloc ;
You can’t perform that action at this time.
0 commit comments