Skip to content

Commit a81260d

Browse files
committed
WIP. Add Miri to Tests workflow for GH Actions
1 parent fda754e commit a81260d

File tree

1 file changed

+29
-1
lines changed

1 file changed

+29
-1
lines changed

.github/workflows/tests.yml

Lines changed: 29 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -118,4 +118,32 @@ jobs:
118118
- name: Architecture check
119119
run: cross run --features cli --bin arch-check --target ${{ matrix.target }}
120120
- name: Test
121-
run: cross test --features cli --target ${{ matrix.target }}
121+
run: cross test --features cli --target ${{ matrix.target }}
122+
123+
miri-test-x86_64:
124+
name: Miri Test x86_64
125+
needs: test-x86_64
126+
runs-on: ubuntu-24.04
127+
steps:
128+
- uses: actions/checkout@v4
129+
- uses: actions-rust-lang/setup-rust-toolchain@9d7e65c320fdb52dcd45ffaa68deb6c02c8754d9
130+
with:
131+
toolchain: nightly
132+
components: miri
133+
- name: Detect CPU cores
134+
id: cores
135+
run: |
136+
CORES=$(nproc)
137+
echo "count=$CORES" >> $GITHUB_OUTPUT
138+
echo "use_nextest=$([[ $CORES -ge 2 ]] && echo 'true' || echo 'false')" >> $GITHUB_OUTPUT
139+
- name: Install nextest
140+
if: steps.cores.outputs.use_nextest == 'true'
141+
run: cargo install cargo-nextest --locked
142+
- name: Setup Miri
143+
run: cargo miri setup
144+
- name: Run Miri tests (parallel)
145+
if: steps.cores.outputs.use_nextest == 'true'
146+
run: cargo miri nextest run --all-features -j${{ steps.cores.outputs.count }}
147+
- name: Run Miri tests (serial)
148+
if: steps.cores.outputs.use_nextest == 'false'
149+
run: cargo miri test --all-features

0 commit comments

Comments
 (0)