Skip to content

Commit

Permalink
try use matrix to optimize sanitize speed
Browse files Browse the repository at this point in the history
  • Loading branch information
PureWhiteWu committed Feb 5, 2025
1 parent 2e59d9a commit fef0b7b
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 6 deletions.
6 changes: 6 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,12 @@ jobs:
cargo fmt -- --check
sanitize:
strategy:
fail-fast: false
matrix:
san: [address, leak]
feature: ["", "arbitrary_precision", "sort_keys", "use_raw", "utf8_lossy"]
name: Sanitize ${{matrix.san}} feature ${{matrix.feature}}
runs-on: [self-hosted, Linux, amd64]
steps:
- uses: actions/checkout@v4
Expand Down
8 changes: 2 additions & 6 deletions scripts/sanitize.sh
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,5 @@ run_tests() {
cargo +nightly test --doc --package sonic-rs --target x86_64-unknown-linux-gnu --features "$features" -- --show-output --test-threads=1
}

for san in address leak; do
for feature in "" "arbitrary_precision" "sort_keys" "use_raw" "utf8_lossy"; do
echo "Running tests with $san and $feature"
RUSTFLAGS="-Zsanitizer=${san}" RUSTDOCFLAGS="-Zsanitizer=${san}" run_tests $san $feature
done
done
echo "Running tests with $san and $feature"
RUSTFLAGS="-Zsanitizer=$1" RUSTDOCFLAGS="-Zsanitizer=$2" run_tests $1 $2

0 comments on commit fef0b7b

Please sign in to comment.