Skip to content

Commit

Permalink
Run Miri on CI
Browse files Browse the repository at this point in the history
The pin guarantees are guarantees of a library, so Miri does not detect
violations of the pin API. However, if the generated unsafe code causes
UB, Miri may be possible to detect it.
  • Loading branch information
taiki-e committed Oct 4, 2020
1 parent 8188642 commit 97d34c2
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 2 deletions.
19 changes: 17 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Install Rust and rustfmt
- name: Install Rust and Rustfmt
run: ci/install-component.sh rustfmt
- name: Install cargo-expand
run: |
Expand All @@ -84,6 +84,19 @@ jobs:
run: |
bash scripts/expandtest.sh
miri:
name: miri
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Install Rust and Miri
run: |
ci/install-component.sh miri
cargo miri setup
- name: cargo miri test
run: |
cargo miri test
clippy:
name: clippy
runs-on: ubuntu-latest
Expand All @@ -100,7 +113,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Install Rust and rustfmt
- name: Install Rust and Rustfmt
run: ci/install-component.sh rustfmt
- name: cargo fmt --check
run: |
Expand Down Expand Up @@ -143,6 +156,7 @@ jobs:
- rustfmt
- rustdoc
- expandtest
- miri
- shellcheck
runs-on: ubuntu-latest
steps:
Expand All @@ -157,6 +171,7 @@ jobs:
- rustfmt
- rustdoc
- expandtest
- miri
- shellcheck
runs-on: ubuntu-latest
steps:
Expand Down
1 change: 1 addition & 0 deletions tests/compiletest.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#![cfg(not(miri))]
#![warn(rust_2018_idioms, single_use_lifetimes)]

#[rustversion::attr(not(nightly), ignore)]
Expand Down
1 change: 1 addition & 0 deletions tests/lint.rs
Original file line number Diff line number Diff line change
Expand Up @@ -310,6 +310,7 @@ pub mod clippy_used_underscore_binding {
}
}

#[cfg(not(miri))]
#[allow(box_pointers)]
#[allow(clippy::restriction)]
#[rustversion::attr(not(nightly), ignore)]
Expand Down

0 comments on commit 97d34c2

Please sign in to comment.