Skip to content

Commit 2da21cf

Browse files
committed
Add miri to ci
1 parent 6ce6a7e commit 2da21cf

File tree

1 file changed

+49
-1
lines changed

1 file changed

+49
-1
lines changed

.github/workflows/ci.yml

Lines changed: 49 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,8 @@ env:
2424
# These Mesa version definition is duplicated in the install-mesa action.
2525
MESA_VERSION: "24.3.4"
2626

27+
# This is the toolchain used for miri tests.
28+
MIRI_TOOLCHAIN: "nightly-2025-07-09"
2729
# This is the MSRV used by `wgpu` itself and all surrounding infrastructure.
2830
REPO_MSRV: "1.84"
2931
# This is the MSRV used by the `wgpu-core`, `wgpu-hal`, and `wgpu-types` crates,
@@ -508,7 +510,7 @@ jobs:
508510

509511
- name: Install repo MSRV toolchain
510512
run: |
511-
rustup toolchain install ${{ env.REPO_MSRV }} --no-self-update --profile=minimal -c llvm-tools
513+
rustup toolchain install ${{ env.MIRI_TOOLCHAIN }} --no-self-update --profile=minimal -c llvm-tools
512514
cargo -V
513515
514516
- name: Install `cargo-nextest` and `cargo-llvm-cov`
@@ -659,6 +661,52 @@ jobs:
659661
files: lcov.info
660662
token: ${{ secrets.CODECOV_TOKEN }}
661663

664+
miri-test:
665+
# runtime is normally 10 minutes
666+
timeout-minutes: 30
667+
668+
name: Miri Test
669+
runs-on: ubuntu-latest
670+
671+
steps:
672+
- name: Checkout repo
673+
uses: actions/checkout@v4
674+
675+
- name: Install repo MSRV toolchain
676+
run: |
677+
rustup toolchain install ${{ env.MIRI_TOOLCHAIN }} --no-self-update --profile=minimal --component miri --target x86_64-unknown-linux-gnu
678+
rustup override set ${{ env.MIRI_TOOLCHAIN }}
679+
cargo -V
680+
681+
- name: Install `cargo-nextest`
682+
uses: taiki-e/install-action@v2
683+
with:
684+
tool: cargo-nextest
685+
686+
- name: Debug symbols to line-tables-only
687+
shell: bash
688+
run: |
689+
mkdir -p .cargo
690+
691+
cat <<EOF >> .cargo/config.toml
692+
[profile.dev]
693+
debug = "line-tables-only"
694+
EOF
695+
696+
- name: Caching
697+
uses: Swatinem/rust-cache@v2
698+
with:
699+
key: miri-${{ env.CACHE_SUFFIX }}
700+
workspaces: |
701+
. -> target
702+
703+
- name: Run tests
704+
shell: bash
705+
run: |
706+
set -e
707+
708+
cargo xtask miri --toolchain ${{ env.MIRI_TOOLCHAIN }}
709+
662710
doctest:
663711
# runtime is normally 2 minutes
664712
timeout-minutes: 10

0 commit comments

Comments
 (0)