From 016b475c32f6ddbcb72d24feac23422c4897273c Mon Sep 17 00:00:00 2001 From: Jonathan Kelley Date: Mon, 8 Jan 2024 14:14:41 -0800 Subject: [PATCH] Fix: move miri to the main CI so it gets run less --- .github/workflows/main.yml | 31 +++++++++ .github/workflows/miri.yml | 133 ------------------------------------- 2 files changed, 31 insertions(+), 133 deletions(-) delete mode 100644 .github/workflows/miri.yml diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index f0b66b951..61a6492fe 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -107,6 +107,37 @@ jobs: - uses: actions/checkout@v4 - run: cargo clippy --workspace --examples --tests -- -D warnings + miri: + env: + CARGO_UNSTABLE_SPARSE_REGISTRY: 'true' + RUSTFLAGS: -Dwarnings + RUST_BACKTRACE: 1 + MIRIFLAGS: -Zmiri-tag-gc=1 + # Change to specific Rust release to pin + rust_stable: stable + rust_nightly: nightly-2023-11-16 + rust_clippy: 1.70.0 + + steps: + - uses: actions/checkout@v4 + - uses: ilammy/setup-nasm@v1 + - name: Install Rust ${{ env.rust_nightly }} + uses: dtolnay/rust-toolchain@master + with: + toolchain: ${{ env.rust_nightly }} + components: miri + - uses: Swatinem/rust-cache@v2 + - name: miri + # Many of tests in tokio/tests and doctests use #[tokio::test] or + # #[tokio::main] that calls epoll_create1 that Miri does not support. + # run: cargo miri test --features full --lib --no-fail-fast + run: | + cargo miri test --package dioxus-core -- --exact --nocapture + cargo miri test --package dioxus-native-core --test miri_native -- --exact --nocapture + env: + MIRIFLAGS: -Zmiri-disable-isolation -Zmiri-strict-provenance -Zmiri-retag-fields + PROPTEST_CASES: 10 + matrix_test: runs-on: ${{ matrix.platform.os }} env: diff --git a/.github/workflows/miri.yml b/.github/workflows/miri.yml deleted file mode 100644 index 6c8a260b3..000000000 --- a/.github/workflows/miri.yml +++ /dev/null @@ -1,133 +0,0 @@ -name: Miri Tests - -on: - push: - # Run in PRs and for bors, but not on master. - branches: - - 'auto' - - 'try' - paths: - - packages/** - - examples/** - - src/** - - .github/** - - lib.rs - - Cargo.toml - pull_request: - types: [opened, synchronize, reopened, ready_for_review] - branches: - - 'master' - schedule: - - cron: '6 6 * * *' # At 6:06 UTC every day. - -env: - CARGO_UNSTABLE_SPARSE_REGISTRY: 'true' - RUSTFLAGS: -Dwarnings - RUST_BACKTRACE: 1 - # Change to specific Rust release to pin - rust_stable: stable - rust_nightly: nightly-2023-11-16 - rust_clippy: 1.70.0 - # When updating this, also update: - # - README.md - # - tokio/README.md - # - CONTRIBUTING.md - # - tokio/Cargo.toml - # - tokio-util/Cargo.toml - # - tokio-test/Cargo.toml - # - tokio-stream/Cargo.toml - # rust_min: 1.49.0 - -concurrency: - group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} - cancel-in-progress: true - -jobs: - test: - runs-on: ${{ matrix.os }} - env: - RUST_BACKTRACE: 1 - HOST_TARGET: ${{ matrix.host_target }} - strategy: - fail-fast: false - matrix: - include: - - os: ubuntu-latest - host_target: x86_64-unknown-linux-gnu - # - os: macos-latest - # host_target: x86_64-apple-darwin - # - os: windows-latest - # host_target: i686-pc-windows-msvc - # - os: windows-latest - # host_target: i686-pc-windows-msvc - # - os: windows-latest - # host_target: i686-pc-windows-msvc - # - os: windows-latest - # host_target: i686-pc-windows-msvc - steps: - - name: Set the tag GC interval to 1 on linux - if: runner.os == 'Linux' - run: echo "MIRIFLAGS=-Zmiri-tag-gc=1" >> $GITHUB_ENV - - - uses: actions/checkout@v4 - - uses: ilammy/setup-nasm@v1 - - name: Install Rust ${{ env.rust_nightly }} - uses: dtolnay/rust-toolchain@master - with: - toolchain: ${{ env.rust_nightly }} - components: miri - - uses: Swatinem/rust-cache@v2 - - name: miri - # Many of tests in tokio/tests and doctests use #[tokio::test] or - # #[tokio::main] that calls epoll_create1 that Miri does not support. - # run: cargo miri test --features full --lib --no-fail-fast - run: | - cargo miri test --package dioxus-core -- --exact --nocapture - cargo miri test --package dioxus-native-core --test miri_native -- --exact --nocapture - - # working-directory: tokio - env: - MIRIFLAGS: -Zmiri-disable-isolation -Zmiri-strict-provenance -Zmiri-retag-fields - PROPTEST_CASES: 10 - - # Cache the global cargo directory, but NOT the local `target` directory which - # we cannot reuse anyway when the nightly changes (and it grows quite large - # over time). - # - name: Add cache for cargo - # id: cache - # uses: actions/cache@v3 - # with: - # path: | - # # Taken from . - # ~/.cargo/bin - # ~/.cargo/registry/index - # ~/.cargo/registry/cache - # ~/.cargo/git/db - # # contains package information of crates installed via `cargo install`. - # ~/.cargo/.crates.toml - # ~/.cargo/.crates2.json - # key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }} - # restore-keys: ${{ runner.os }}-cargo - - # - name: Install rustup-toolchain-install-master - # if: ${{ steps.cache.outputs.cache-hit != 'true' }} - # shell: bash - # run: | - # cargo install -f rustup-toolchain-install-master - # - name: Install "master" toolchain - # shell: bash - # run: | - # if [[ ${{ github.event_name }} == 'schedule' ]]; then - # echo "Building against latest rustc git version" - # git ls-remote https://github.com/rust-lang/rust/ HEAD | cut -f 1 > rust-version - # fi - # toolchain --host ${{ matrix.host_target }} - # - name: Show Rust version - # run: | - # rustup show - # rustc -Vv - # cargo -V - # - name: Test - # run: | - # MIRIFLAGS="-Zmiri-disable-isolation -Zmiri-ignore-leaks" cargo +nightly miri test --package dioxus-core --test miri_stress -- --exact --nocapture - # MIRIFLAGS="-Zmiri-disable-isolation -Zmiri-ignore-leaks" cargo +nightly miri test --package dioxus-native-core --test miri_native -- --exact --nocapture