miri.yml 4.5 KB

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