25
25
rust : beta
26
26
- os : windows-latest
27
27
rust : beta
28
- - os : macos-latest
29
- rust : nightly
30
28
31
29
runs-on : ${{ matrix.os }}
32
30
@@ -35,12 +33,21 @@ jobs:
35
33
- uses : dtolnay/rust-toolchain@master
36
34
with :
37
35
toolchain : ${{ matrix.rust }}
36
+ components : ${{ matrix.rust == 'nightly' && 'rust-src' || '' }}
38
37
# Add toolchain for no_std tests
39
38
- run : rustup toolchain install nightly
40
- - name : Downgrade idna_adapter on Rust 1.63.0
39
+ - name : Downgrade deps on Rust 1.63.0
41
40
if : |
42
41
matrix.rust == '1.63.0'
43
- run : cargo update -p idna_adapter --precise 1.1.0
42
+ run : |
43
+ cargo update -p idna_adapter --precise 1.1.0
44
+ - name : Downgrade deps on Rust 1.67.0
45
+ if : |
46
+ matrix.rust == '1.67.0'
47
+ run : |
48
+ cargo update -p zerofrom --precise 0.1.4
49
+ cargo update -p yoke --precise 0.7.4
50
+ cargo update -p litemap --precise 0.7.3
44
51
- name : Add `aarch64-unknown-none` toolchain for `no_std` tests
45
52
if : |
46
53
matrix.os == 'ubuntu-latest' &&
71
78
run : >
72
79
cd url
73
80
&& cargo check --target aarch64-unknown-none -v --no-default-features
81
+ - name : Run tests with sanitizers
82
+ if : (matrix.os == 'ubuntu-latest' || matrix.os == 'macos-latest') && matrix.rust == 'nightly'
83
+ env :
84
+ ASAN_OPTIONS : detect_leaks=1:detect_stack_use_after_return=1
85
+ run : |
86
+ if [ "${{ matrix.os }}" = "ubuntu-latest" ]; then
87
+ sudo apt-get install -y --no-install-recommends llvm
88
+ TARGET="x86_64-unknown-linux-gnu"
89
+ SANITIZERS="address thread leak memory"
90
+ elif [ "${{ matrix.os }}" = "macos-latest" ]; then
91
+ TARGET="aarch64-apple-darwin"
92
+ # no memory and leak sanitizer support yet
93
+ SANITIZERS="address thread"
94
+ # Suppress non-crate leaks on macOS. TODO: Check occasionally if these are still needed.
95
+ {
96
+ echo "leak:dyld4::RuntimeState"
97
+ echo "leak:fetchInitializingClassList"
98
+ } > suppressions.txt
99
+ export LSAN_OPTIONS="suppressions=$(pwd)/suppressions.txt"
100
+ fi
101
+ for sanitizer in $SANITIZERS; do
102
+ echo "Running tests with $sanitizer sanitizer..."
103
+ export RUSTFLAGS="-Z sanitizer=$sanitizer"
104
+ export RUSTDOCFLAGS="$RUSTFLAGS"
105
+ cargo +nightly test -Z build-std --target "$TARGET"
106
+ done
74
107
75
108
WASM :
76
109
runs-on : ubuntu-latest
0 commit comments