-
Notifications
You must be signed in to change notification settings - Fork 127
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ci: Run the sanitizers in parallel (#2166)
* ci: Run the sanitizers in parallel * Fixes * Again * Again * Again * Again * Finalize * Update .github/workflows/check.yml Co-authored-by: Max Inden <[email protected]> Signed-off-by: Lars Eggert <[email protected]> * Refactor into separate workflow * Again * Again * llvm * memory * No memory * ASAN_OPTIONS: detect_leaks=1:detect_stack_use_after_return=1 * actionlint * Suppress * LSAN_OPTIONS * Remove comment * Again * pwd --------- Signed-off-by: Lars Eggert <[email protected]> Co-authored-by: Max Inden <[email protected]>
- Loading branch information
1 parent
5f8d876
commit 249d062
Showing
3 changed files
with
98 additions
and
25 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,78 @@ | ||
name: Sanitize | ||
on: | ||
push: | ||
branches: ["main"] | ||
paths-ignore: ["*.md", "*.png", "*.svg", "LICENSE-*"] | ||
pull_request: | ||
branches: ["main"] | ||
paths-ignore: ["*.md", "*.png", "*.svg", "LICENSE-*"] | ||
merge_group: | ||
workflow_dispatch: | ||
env: | ||
CARGO_TERM_COLOR: always | ||
RUST_BACKTRACE: 1 | ||
|
||
concurrency: | ||
group: ${{ github.workflow }}-${{ github.ref_name }} | ||
cancel-in-progress: true | ||
|
||
permissions: | ||
contents: read | ||
|
||
defaults: | ||
run: | ||
shell: bash | ||
|
||
jobs: | ||
sanitize: | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
os: [ubuntu-latest, macos-latest] # No Windows support for sanitizers. | ||
sanitizer: [address, thread, leak] # TODO: memory | ||
exclude: | ||
# Memory and leak sanitizers are not supported on macOS. | ||
- os: macos-latest | ||
sanitizer: leak | ||
# - os: macos-latest | ||
# sanitizer: memory | ||
runs-on: ${{ matrix.os }} | ||
|
||
steps: | ||
- uses: actions/checkout@d632683dd7b4114ad314bca15554477dd762a938 # v4.2.0 | ||
- uses: ./.github/actions/rust | ||
with: | ||
version: nightly | ||
components: rust-src | ||
tools: cargo-nextest | ||
token: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
- id: nss-version | ||
run: echo "minimum=$(cat neqo-crypto/min_version.txt)" >> "$GITHUB_OUTPUT" | ||
|
||
- uses: ./.github/actions/nss | ||
with: | ||
minimum-version: ${{ steps.nss-version.outputs.minimum }} | ||
|
||
- name: Run tests with sanitizers | ||
env: | ||
RUST_LOG: trace | ||
RUSTFLAGS: "-Z sanitizer=${{ matrix.sanitizer }}" | ||
RUSTDOCFLAGS: "-Z sanitizer=${{ matrix.sanitizer }}" | ||
ASAN_OPTIONS: detect_leaks=1:detect_stack_use_after_return=1 | ||
run: | | ||
if [ "${{ matrix.os }}" = "ubuntu-latest" ]; then | ||
sudo apt-get install -y --no-install-recommends llvm | ||
TARGET="x86_64-unknown-linux-gnu" | ||
elif [ "${{ matrix.os }}" = "macos-latest" ]; then | ||
# llvm-symbolizer (as part of llvm) is installed by default on macOS runners | ||
TARGET="aarch64-apple-darwin" | ||
# Suppress non-neqo leaks on macOS. TODO: Check occasionally if these are still needed. | ||
{ | ||
echo "leak:dyld4::RuntimeState" | ||
echo "leak:fetchInitializingClassList" | ||
} > suppressions.txt | ||
PWD=$(pwd) | ||
export LSAN_OPTIONS="suppressions=$PWD/suppressions.txt" | ||
fi | ||
cargo nextest run -Z build-std --features ci --target "$TARGET" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters