Skip to content

Commit 5aeff5d

Browse files
committed
Auto merge of #2006 - RalfJung:readme-ci, r=RalfJung
update recommended CI snippet, add GHA example If this snippet works as expected in rust-lang/portable-simd#255 (which we can test tomorrow), then this adjusts our README to that nicer script.
2 parents 722475c + c035752 commit 5aeff5d

File tree

1 file changed

+25
-8
lines changed

1 file changed

+25
-8
lines changed

README.md

+25-8
Original file line numberDiff line numberDiff line change
@@ -144,20 +144,37 @@ endian-sensitive code.
144144
### Running Miri on CI
145145

146146
To run Miri on CI, make sure that you handle the case where the latest nightly
147-
does not ship the Miri component because it currently does not build. For
148-
example, you can use the following snippet to always test with the latest
149-
nightly that *does* come with Miri:
147+
does not ship the Miri component because it currently does not build. `rustup
148+
toolchain install --component` knows how to handle this situation, so the
149+
following snippet should always work:
150150

151151
```sh
152-
MIRI_NIGHTLY=nightly-$(curl -s https://rust-lang.github.io/rustup-components-history/x86_64-unknown-linux-gnu/miri)
153-
echo "Installing latest nightly with Miri: $MIRI_NIGHTLY"
154-
rustup set profile minimal
155-
rustup override set "$MIRI_NIGHTLY"
156-
rustup component add miri
152+
rustup toolchain install nightly --component miri
153+
rustup override set nightly
157154

158155
cargo miri test
159156
```
160157

158+
Here is an example job for GitHub Actions:
159+
160+
```yaml
161+
miri:
162+
name: "Miri"
163+
runs-on: ubuntu-latest
164+
steps:
165+
- uses: actions/checkout@v2
166+
- name: Install Miri
167+
run: |
168+
rustup toolchain install nightly --component miri
169+
rustup override set nightly
170+
cargo miri setup
171+
- name: Test with Miri
172+
run: cargo miri test
173+
```
174+
175+
The explicit `cargo miri setup` helps to keep the output of the actual test step
176+
clean.
177+
161178
### Common Problems
162179

163180
When using the above instructions, you may encounter a number of confusing compiler

0 commit comments

Comments
 (0)