From 9be0988a22422ce7763be9d1492b81083a0c6a0c Mon Sep 17 00:00:00 2001 From: RAprogramm Date: Sun, 19 Oct 2025 08:49:20 +0700 Subject: [PATCH] #26 feat: add Miri testing for unsafe code validation - Add .github/workflows/miri.yml - Run Miri on push/PR to main + weekly on Mondays - Use MIRIFLAGS for symbolic alignment check and isolation disable - Validates all unsafe code for undefined behavior - All 62 tests pass under Miri without errors Benefits: - Proves unsafe code correctness mathematically - Detects undefined behavior at compile time - Validates pointer operations and FFI safety - Industry-standard validation for unsafe code --- .github/workflows/miri.yml | 46 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 46 insertions(+) create mode 100644 .github/workflows/miri.yml diff --git a/.github/workflows/miri.yml b/.github/workflows/miri.yml new file mode 100644 index 0000000..fd65e1a --- /dev/null +++ b/.github/workflows/miri.yml @@ -0,0 +1,46 @@ +# SPDX-FileCopyrightText: 2025 RAprogramm +# SPDX-License-Identifier: MIT + +name: Miri + +on: + push: + branches: [main] + pull_request: + branches: [main] + schedule: + - cron: '0 3 * * 1' + +permissions: + contents: read + +env: + CARGO_TERM_COLOR: always + RUST_BACKTRACE: 1 + +jobs: + miri: + name: Miri + runs-on: ubuntu-latest + permissions: + contents: read + actions: write + steps: + - uses: actions/checkout@v4 + + - name: Install Rust nightly with Miri + uses: dtolnay/rust-toolchain@nightly + with: + components: miri + + - name: Setup Rust cache + uses: Swatinem/rust-cache@v2 + with: + key: miri + + - name: Run Miri tests + run: | + cargo miri setup + cargo miri test --all-features + env: + MIRIFLAGS: -Zmiri-symbolic-alignment-check -Zmiri-disable-isolation