3535 - uses : actions/setup-node@v5
3636 with :
3737 node-version : 22
38- cache : ' yarn'
38+ cache : " yarn"
3939 - name : Install dependencies
4040 run : yarn install
4141 - name : Download fixtures
5858 - uses : actions/setup-node@v5
5959 with :
6060 node-version : 22
61- cache : ' yarn'
61+ cache : " yarn"
6262 - name : Install dependencies
6363 run : yarn install
6464 - name : Download fixtures
@@ -69,6 +69,110 @@ jobs:
6969 run : cargo miri test
7070 env :
7171 MIRIFLAGS : " -Zmiri-disable-isolation"
72+
73+ asan :
74+ name : ASAN - Linux-x86_64 - ${{ matrix.asan.flag }}
75+ runs-on : ubuntu-24.04
76+ strategy :
77+ fail-fast : false
78+ matrix :
79+ asan :
80+ - flag : sanitizer=address
81+ options : detect_leaks=1 detect_stack_use_after_return=1
82+ - flag : sanitizer=memory
83+ options : " "
84+ - flag : sanitizer=safestack
85+ options : " "
86+
87+ steps :
88+ - uses : actions/checkout@v5
89+
90+ - name : Setup node
91+ uses : actions/setup-node@v5
92+ with :
93+ node-version : 22
94+ cache : " yarn"
95+
96+ - name : Install Rust
97+ uses : dtolnay/rust-toolchain@stable
98+ with :
99+ toolchain : nightly
100+ components : rust-src
101+
102+ - name : Install dependencies
103+ run : yarn install --immutable --mode=skip-build
104+
105+ - name : Download fixtures
106+ run : node download-fixtures.js
107+ env :
108+ GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
109+
110+ - name : Test with ASAN
111+ run : cargo test --tests --target x86_64-unknown-linux-gnu
112+ env :
113+ RUST_TARGET : x86_64-unknown-linux-gnu
114+ RUST_BACKTRACE : 1
115+ RUSTFLAGS : " -Z${{ matrix.asan.flag }}"
116+ ASAN_OPTIONS : ${{ matrix.asan.options }}
117+ CARGO_UNSTABLE_BUILD_STD : std,panic_abort
118+
119+
120+ asan-win32 :
121+ name : ASAN - Windows-x86_64
122+ runs-on : windows-latest
123+
124+ steps :
125+ - uses : actions/checkout@v5
126+
127+ - name : Setup node
128+ uses : actions/setup-node@v5
129+ with :
130+ node-version : 22
131+ cache : " yarn"
132+
133+ - name : Install Rust
134+ uses : dtolnay/rust-toolchain@stable
135+ with :
136+ toolchain : nightly
137+ components : rust-src
138+
139+ - name : Install dependencies
140+ run : yarn install --immutable --mode=skip-build
141+
142+ - name : Download fixtures
143+ run : node download-fixtures.js
144+ env :
145+ GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
146+
147+ - name : Test with ASAN (Windows)
148+ shell : pwsh
149+ run : |
150+ # Set ASAN environment variables for Windows
151+ $env:ASAN_OPTIONS = "windows_hook_rtl_allocators=true:detect_leaks=0:print_stats=1:check_initialization_order=true:strict_string_checks=true"
152+
153+ # Find and set the path to the ASAN runtime DLL
154+ $vsPath = & "${env:ProgramFiles(x86)}\Microsoft Visual Studio\Installer\vswhere.exe" -latest -property installationPath
155+ $asanDllPath = Get-ChildItem -Path "$vsPath\VC\Tools\MSVC" -Recurse -Filter "clang_rt.asan_dynamic-x86_64.dll" | Select-Object -First 1
156+ if ($asanDllPath) {
157+ $env:PATH = "$($asanDllPath.DirectoryName);$env:PATH"
158+ Write-Host "Found ASAN DLL at: $($asanDllPath.FullName)"
159+ }
160+ cargo test --tests --target x86_64-pc-windows-msvc
161+ env :
162+ RUSTFLAGS : -Zsanitizer=address
163+ RUST_BACKTRACE : 1
164+ CARGO_PROFILE_DEV_OPT_LEVEL : 1
165+ CARGO_UNSTABLE_BUILD_STD : std,panic_abort
166+
167+ - name : Upload ASAN logs (Windows)
168+ if : failure()
169+ uses : actions/upload-artifact@v4
170+ with :
171+ name : windows-asan-logs
172+ path : |
173+ asan.log*
174+ *.asan.log
175+
72176 bench :
73177 strategy :
74178 matrix :
94198 - uses : actions/setup-node@v5
95199 with :
96200 node-version : 22
97- cache : ' yarn'
201+ cache : " yarn"
98202 - name : Install dependencies
99203 run : yarn install
100204 - name : Download fixtures
@@ -104,4 +208,11 @@ jobs:
104208 - name : Run benchmarks
105209 run : cargo bench
106210 env :
107- RUSTFLAGS : ' -C target-cpu=native'
211+ RUSTFLAGS : " -C target-cpu=native"
212+
213+ done :
214+ runs-on : ubuntu-latest
215+ needs : [test, miri, asan, asan-win32, bench]
216+ steps :
217+ - run : exit 1
218+ if : ${{ always() && (contains(needs.*.result, 'failure') || contains(needs.*.result, 'cancelled')) }}
0 commit comments