Skip to content

Commit 65fb965

Browse files
committed
CI: run tests under miri
1 parent 8edf358 commit 65fb965

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

.github/workflows/CI-linux.yml

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@ on:
4343
env:
4444
DEBIAN_FRONTEND: noninteractive
4545
RUSTFLAGS: "-Dwarnings"
46+
WITH_MIRI: ${{ inputs.rust-toolchain-name == 'nightly' && inputs.flavor == 'dev' }}
4647
SRC_DIR: ${{ github.workspace }}/rawspeed.rs
4748
CODECOV_TOKEN_EXISTS: ${{ secrets.CODECOV_TOKEN != '' }}
4849
CODE_COVERAGE_SUPPORTED: ${{ inputs.flavor != 'RustFmt' && inputs.flavor != 'doc' && (inputs.target-os != 'windows' || inputs.rust-toolchain-abi == 'msvc') }}
@@ -289,6 +290,10 @@ jobs:
289290
else
290291
exit 1
291292
fi
293+
if [ "${{ env.WITH_MIRI }}" = "true" ]; then
294+
eatmydata rustup component add miri
295+
eatmydata rustup component add rust-src
296+
fi
292297
- name: Install necessary Rust packages for code coverage
293298
if: env.CODE_COVERAGE_SUPPORTED == 'true' && (inputs.builder-host == inputs.builder-target || (env.ENDIANNESS == 'big' && inputs.builder-target != 's390x')) && (github.event_name == 'pull_request' || env.CODECOV_TOKEN_EXISTS == 'true')
294299
timeout-minutes: 2
@@ -435,6 +440,14 @@ jobs:
435440
files: ${{ env.SRC_DIR }}/codecov.json
436441
root_dir: ${{ env.SRC_DIR }}
437442
fail_ci_if_error: true
443+
- name: Run tests under Miri
444+
timeout-minutes: 5
445+
if: env.WITH_MIRI == 'true'
446+
run: |
447+
set -xe
448+
. "$HOME/.cargo/env"
449+
cd "$SRC_DIR"
450+
cargo miri test --target ${{ env.RUST_TARGET }}
438451
- name: Build docs
439452
timeout-minutes: 1
440453
if: inputs.flavor == 'doc'

0 commit comments

Comments
 (0)