Skip to content
This repository has been archived by the owner on Mar 26, 2024. It is now read-only.

Commit

Permalink
Add CI job to run tests using Miri
Browse files Browse the repository at this point in the history
Miri is an experimental interpreter that can detect certain classes of
undefined behavior.

See:
- https://github.com/rust-lang/miri
  • Loading branch information
elasticdog committed May 16, 2023
1 parent 38c392c commit 9ea7ce7
Show file tree
Hide file tree
Showing 2 changed files with 56 additions and 17 deletions.
58 changes: 41 additions & 17 deletions .github/cue/scheduled.cue
Original file line number Diff line number Diff line change
Expand Up @@ -23,22 +23,46 @@ scheduled: {
RUSTFLAGS: "-D warnings"
}

jobs: direct_minimal_versions: {
name: "direct-minimal-versions / stable"
"runs-on": defaultRunner
steps: [
_#checkoutCode,
_#installRust,
_#installRust & {with: toolchain: "nightly"},
{
name: "Default to stable Rust"
run: "rustup default stable"
},
{
name: "Resolve minimal dependency versions instead of maximum"
run: "cargo +nightly update -Z direct-minimal-versions"
},
for step in _testRust {step},
]
jobs: {
direct_minimal_versions: {
name: "direct-minimal-versions / stable"
"runs-on": defaultRunner
steps: [
_#checkoutCode,
_#installRust,
_#installRust & {with: toolchain: "nightly"},
{
name: "Default to stable Rust"
run: "rustup default stable"
},
{
name: "Resolve minimal dependency versions instead of maximum"
run: "cargo +nightly update -Z direct-minimal-versions"
},
for step in _testRust {step},
]
}

// https://github.com/rust-lang/miri
// Detect certain classes of undefined behavior.
miri: {
name: "test / miri"
"runs-on": defaultRunner
steps: [
_#checkoutCode,
_#installRust & {with: {
toolchain: "nightly"
components: "miri"
}},
{
name: "Setup Miri environment"
run: "cargo miri setup"
},
{
name: "Run tests with Miri"
run: "cargo miri test"
},
]
}
}
}
15 changes: 15 additions & 0 deletions .github/workflows/scheduled.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,3 +42,18 @@ jobs:
run: cargo nextest run --locked --all-targets --all-features
- name: Run doctests
run: cargo test --locked --doc
miri:
name: test / miri
runs-on: ubuntu-latest
steps:
- name: Checkout source code
uses: actions/checkout@8e5e7e5ab8b370d6c329ec480221332ada57f0ab
- name: Install nightly Rust toolchain
uses: dtolnay/rust-toolchain@b44cb146d03e8d870c57ab64b80f04586349ca5d
with:
toolchain: nightly
components: miri
- name: Setup Miri environment
run: cargo miri setup
- name: Run tests with Miri
run: cargo miri test

0 comments on commit 9ea7ce7

Please sign in to comment.