File tree 1 file changed +25
-8
lines changed
1 file changed +25
-8
lines changed Original file line number Diff line number Diff line change @@ -144,20 +144,37 @@ endian-sensitive code.
144
144
### Running Miri on CI
145
145
146
146
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 :
150
150
151
151
``` 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
157
154
158
155
cargo miri test
159
156
```
160
157
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
+
161
178
# ## Common Problems
162
179
163
180
When using the above instructions, you may encounter a number of confusing compiler
You can’t perform that action at this time.
0 commit comments