File tree Expand file tree Collapse file tree 1 file changed +33
-0
lines changed Expand file tree Collapse file tree 1 file changed +33
-0
lines changed Original file line number Diff line number Diff line change @@ -213,3 +213,36 @@ jobs:
213213 PROPTEST_CASES : " 10"
214214 MIRIFLAGS : " -Zmiri-disable-isolation"
215215 run : cargo miri test --all-features
216+
217+ thread_sanitizer-MacOS :
218+ name : Thread Sanitizer checks MacOS
219+ runs-on : macos-latest
220+
221+ steps :
222+ - uses : actions/checkout@v2
223+ - uses : actions/cache@v2
224+ with :
225+ path : |
226+ ~/.cargo/bin/
227+ ~/.cargo/registry/index/
228+ ~/.cargo/registry/cache/
229+ ~/.cargo/git/db/
230+ target/
231+ key : ${{ github.event.repository.name }}-${{ runner.os }}-cargo-thread_sanitizer-v2
232+ - name : Install latest nightly
233+ uses : actions-rs/toolchain@v1
234+ with :
235+ toolchain : nightly
236+ override : true
237+ components : rust-src
238+ - name : Run thread sanitizer
239+ run : |
240+ # Thread sanitizer isn't guaranteed to catch all data races, it can only catch it
241+ # the data race if it happens when running the program.
242+ #
243+ # Running the tests multiple times increase the chances that data races are found
244+ # by the thread sanitizer.
245+ for _ in $(seq 1 10); do cargo +nightly test -Z build-std --target --target $(uname -m)-apple-darwin; done
246+ env :
247+ RUSTDOCFLAGS : " -Zsanitizer=thread"
248+ RUSTFLAGS : " -Zsanitizer=thread"
You can’t perform that action at this time.
0 commit comments