From 720d5064d07d63ae99f73eff4c509946ff20d242 Mon Sep 17 00:00:00 2001 From: Andrew Duffy Date: Tue, 20 Aug 2024 16:49:16 -0400 Subject: [PATCH] add miri action --- .github/workflows/miri.yml | 52 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 52 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..068177a --- /dev/null +++ b/.github/workflows/miri.yml @@ -0,0 +1,52 @@ +name: Miri + +on: + push: + branches: ["develop"] + pull_request: {} + workflow_dispatch: {} + +permissions: + actions: read + contents: read + +jobs: + miri: + name: "miri" + runs-on: ubuntu-latest + env: + RUST_BACKTRACE: 1 + MIRIFLAGS: -Zmiri-strict-provenance -Zmiri-symbolic-alignment-check -Zmiri-backtrace=full + steps: + - uses: actions/checkout@v4 + + - name: Rust Version + id: rust-version + shell: bash + run: echo "version=$(cat rust-toolchain.toml | grep channel | awk -F'\"' '{print $2}')" >> $GITHUB_OUTPUT + + - name: Rust Toolchain + id: rust-toolchain + uses: dtolnay/rust-toolchain@master + if: steps.rustup-cache.outputs.cache-hit != 'true' + with: + toolchain: "${{ steps.rust-version.outputs.version }}" + components: miri + + - name: Rust Dependency Cache + uses: Swatinem/rust-cache@v2 + with: + save-if: ${{ github.ref == 'refs/heads/develop' }} + shared-key: "shared" # To allow reuse across jobs + + - name: Rust Compile Cache + uses: mozilla-actions/sccache-action@v0.0.5 + - name: Rust Compile Cache Config + shell: bash + run: | + echo "SCCACHE_GHA_ENABLED=true" >> $GITHUB_ENV + echo "RUSTC_WRAPPER=sccache" >> $GITHUB_ENV + echo "CARGO_INCREMENTAL=0" >> $GITHUB_ENV + + - name: Run tests with Miri + run: cargo miri test