miri.yml 4.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124
  1. name: Miri Tests
  2. on:
  3. push:
  4. # Run in PRs and for bors, but not on master.
  5. branches:
  6. - 'auto'
  7. - 'try'
  8. pull_request:
  9. types: [opened, synchronize, reopened, ready_for_review]
  10. branches:
  11. - 'master'
  12. schedule:
  13. - cron: '6 6 * * *' # At 6:06 UTC every day.
  14. env:
  15. CARGO_UNSTABLE_SPARSE_REGISTRY: 'true'
  16. RUSTFLAGS: -Dwarnings
  17. RUST_BACKTRACE: 1
  18. # Change to specific Rust release to pin
  19. rust_stable: stable
  20. rust_nightly: nightly-2022-11-03
  21. rust_clippy: 1.65.0
  22. # When updating this, also update:
  23. # - README.md
  24. # - tokio/README.md
  25. # - CONTRIBUTING.md
  26. # - tokio/Cargo.toml
  27. # - tokio-util/Cargo.toml
  28. # - tokio-test/Cargo.toml
  29. # - tokio-stream/Cargo.toml
  30. # rust_min: 1.49.0
  31. jobs:
  32. test:
  33. runs-on: ${{ matrix.os }}
  34. env:
  35. RUST_BACKTRACE: 1
  36. HOST_TARGET: ${{ matrix.host_target }}
  37. strategy:
  38. fail-fast: false
  39. matrix:
  40. include:
  41. - os: ubuntu-latest
  42. host_target: x86_64-unknown-linux-gnu
  43. # - os: macos-latest
  44. # host_target: x86_64-apple-darwin
  45. # - os: windows-latest
  46. # host_target: i686-pc-windows-msvc
  47. # - os: windows-latest
  48. # host_target: i686-pc-windows-msvc
  49. # - os: windows-latest
  50. # host_target: i686-pc-windows-msvc
  51. # - os: windows-latest
  52. # host_target: i686-pc-windows-msvc
  53. steps:
  54. - name: Set the tag GC interval to 1 on linux
  55. if: runner.os == 'Linux'
  56. run: echo "MIRIFLAGS=-Zmiri-tag-gc=1" >> $GITHUB_ENV
  57. - uses: actions/checkout@v3
  58. - name: Install Rust ${{ env.rust_nightly }}
  59. uses: dtolnay/rust-toolchain@master
  60. with:
  61. toolchain: ${{ env.rust_nightly }}
  62. components: miri
  63. - uses: Swatinem/rust-cache@v2
  64. - name: miri
  65. # Many of tests in tokio/tests and doctests use #[tokio::test] or
  66. # #[tokio::main] that calls epoll_create1 that Miri does not support.
  67. # run: cargo miri test --features full --lib --no-fail-fast
  68. run: |
  69. cargo miri test --package dioxus-core --test miri_stress -- --exact --nocapture
  70. cargo miri test --package dioxus-native-core --test miri_native -- --exact --nocapture
  71. # working-directory: tokio
  72. env:
  73. # todo: disable memory leaks ignore
  74. MIRIFLAGS: -Zmiri-disable-isolation -Zmiri-strict-provenance -Zmiri-retag-fields -Zmiri-ignore-leaks
  75. PROPTEST_CASES: 10
  76. # Cache the global cargo directory, but NOT the local `target` directory which
  77. # we cannot reuse anyway when the nightly changes (and it grows quite large
  78. # over time).
  79. # - name: Add cache for cargo
  80. # id: cache
  81. # uses: actions/cache@v3
  82. # with:
  83. # path: |
  84. # # Taken from <https://doc.rust-lang.org/nightly/cargo/guide/cargo-home.html#caching-the-cargo-home-in-ci>.
  85. # ~/.cargo/bin
  86. # ~/.cargo/registry/index
  87. # ~/.cargo/registry/cache
  88. # ~/.cargo/git/db
  89. # # contains package information of crates installed via `cargo install`.
  90. # ~/.cargo/.crates.toml
  91. # ~/.cargo/.crates2.json
  92. # key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
  93. # restore-keys: ${{ runner.os }}-cargo
  94. # - name: Install rustup-toolchain-install-master
  95. # if: ${{ steps.cache.outputs.cache-hit != 'true' }}
  96. # shell: bash
  97. # run: |
  98. # cargo install -f rustup-toolchain-install-master
  99. # - name: Install "master" toolchain
  100. # shell: bash
  101. # run: |
  102. # if [[ ${{ github.event_name }} == 'schedule' ]]; then
  103. # echo "Building against latest rustc git version"
  104. # git ls-remote https://github.com/rust-lang/rust/ HEAD | cut -f 1 > rust-version
  105. # fi
  106. # toolchain --host ${{ matrix.host_target }}
  107. # - name: Show Rust version
  108. # run: |
  109. # rustup show
  110. # rustc -Vv
  111. # cargo -V
  112. # - name: Test
  113. # run: |
  114. # MIRIFLAGS="-Zmiri-disable-isolation -Zmiri-ignore-leaks" cargo +nightly miri test --package dioxus-core --test miri_stress -- --exact --nocapture
  115. # MIRIFLAGS="-Zmiri-disable-isolation -Zmiri-ignore-leaks" cargo +nightly miri test --package dioxus-native-core --test miri_native -- --exact --nocapture