Skip to content

Commit 3ce228e

Browse files
committed
CI: run tests under Miri
1 parent a91ff7c commit 3ce228e

File tree

2 files changed

+29
-2
lines changed

2 files changed

+29
-2
lines changed

.github/workflows/CI-linux.yml

Lines changed: 19 additions & 1 deletion
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' && inputs.builder-target != 'riscv64' }}
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') }}
@@ -274,7 +275,7 @@ jobs:
274275
eatmydata apt clean
275276
rm -rf /var/lib/apt/lists/*
276277
- name: Install Rust toolchain and targets and crates
277-
timeout-minutes: 3
278+
timeout-minutes: 4
278279
run: |
279280
set -xe
280281
RUST_COMPONENTS=""
@@ -305,6 +306,15 @@ jobs:
305306
cargo-llvm-cov \
306307
"
307308
fi
309+
if [ "${{ env.WITH_MIRI }}" = "true" ]; then
310+
RUST_COMPONENTS="${RUST_COMPONENTS} \
311+
rust-src \
312+
miri \
313+
"
314+
RUST_CRATES="${RUST_CRATES} \
315+
cargo-nextest \
316+
"
317+
fi
308318
eatmydata rustup component add ${RUST_COMPONENTS}
309319
if [ "${RUST_CRATES}" != "" ]; then
310320
eatmydata cargo install ${RUST_CRATES}
@@ -447,6 +457,14 @@ jobs:
447457
files: ${{ env.SRC_DIR }}/codecov.json
448458
root_dir: ${{ env.SRC_DIR }}
449459
fail_ci_if_error: true
460+
- name: Run tests under Miri
461+
timeout-minutes: 10
462+
if: env.WITH_MIRI == 'true'
463+
run: |
464+
set -xe
465+
. "$HOME/.cargo/env"
466+
cd "$SRC_DIR"
467+
cargo miri nextest run --target ${{ env.RUST_TARGET }}
450468
- name: Build docs
451469
timeout-minutes: 1
452470
if: inputs.flavor == 'doc'

.github/workflows/CI-macOS.yml

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ on:
3030

3131
env:
3232
RUSTFLAGS: "-Dwarnings"
33+
WITH_MIRI: ${{ inputs.rust-toolchain-name == 'nightly' && inputs.flavor == 'dev' }}
3334
SRC_DIR: ${{ github.workspace }}/rawspeed.rs
3435
CODECOV_TOKEN_EXISTS: ${{ secrets.CODECOV_TOKEN != '' }}
3536

@@ -60,7 +61,7 @@ jobs:
6061
brew autoremove --quiet
6162
brew cleanup --quiet --prune=all
6263
- name: Install Rust
63-
timeout-minutes: 4
64+
timeout-minutes: 7
6465
run: |
6566
set -xe
6667
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- --default-toolchain none -y
@@ -156,3 +157,11 @@ jobs:
156157
files: ${{ env.SRC_DIR }}/codecov.json
157158
root_dir: ${{ env.SRC_DIR }}
158159
fail_ci_if_error: true
160+
- name: Run tests under Miri
161+
timeout-minutes: 10
162+
if: env.WITH_MIRI == 'true'
163+
run: |
164+
set -xe
165+
. "$HOME/.cargo/env"
166+
cd "$SRC_DIR"
167+
cargo miri nextest run

0 commit comments

Comments
 (0)