refactor!: do not reserve memory in escape_into #150
Workflow file for this run
This file contains hidden or 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
name: CI | |
on: | |
push: | |
branches: | |
- main | |
pull_request: | |
branches: | |
- main | |
jobs: | |
test: | |
strategy: | |
matrix: | |
settings: | |
- target: x86_64-unknown-linux-gnu | |
os: ubuntu-latest | |
- target: x86_64-pc-windows-msvc | |
os: windows-latest | |
- target: aarch64-unknown-linux-gnu | |
os: ubuntu-24.04-arm | |
- target: aarch64-apple-darwin | |
os: macos-latest | |
fail-fast: false | |
runs-on: ${{ matrix.settings.os }} | |
steps: | |
- uses: actions/checkout@v5 | |
- name: Setup Rust | |
uses: dtolnay/rust-toolchain@stable | |
with: | |
targets: ${{ matrix.settings.target }} | |
- name: print cpu features | |
run: | | |
rustup toolchain install nightly | |
cargo +nightly run -p cpu-features --features nightly | |
- uses: actions/setup-node@v5 | |
with: | |
node-version: 22 | |
cache: "yarn" | |
- name: Install dependencies | |
run: yarn install | |
- name: Download fixtures | |
run: node download-fixtures.js | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
- name: Run tests | |
run: | | |
cargo clippy --all-targets --all-features -- -D warnings | |
cargo fmt --all -- --check | |
cargo test | |
miri: | |
runs-on: ${{ matrix.os }} | |
strategy: | |
fail-fast: false | |
matrix: | |
os: [ubuntu-latest, macos-latest] | |
steps: | |
- uses: actions/checkout@v5 | |
- name: Setup Rust | |
uses: dtolnay/rust-toolchain@stable | |
with: | |
components: miri,rust-src | |
toolchain: nightly | |
- uses: actions/setup-node@v5 | |
with: | |
node-version: 22 | |
cache: "yarn" | |
- name: Install dependencies | |
run: yarn install | |
- name: Download fixtures | |
run: node download-fixtures.js | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
- name: Run miri | |
run: cargo miri test | |
env: | |
MIRIFLAGS: "-Zmiri-disable-isolation" | |
asan: | |
name: ASAN - Linux-x86_64 - ${{ matrix.asan.flag }} | |
runs-on: ubuntu-24.04 | |
strategy: | |
fail-fast: false | |
matrix: | |
asan: | |
- flag: sanitizer=address | |
options: detect_leaks=1 detect_stack_use_after_return=1 | |
- flag: sanitizer=memory | |
options: "" | |
- flag: sanitizer=safestack | |
options: "" | |
steps: | |
- uses: actions/checkout@v5 | |
- name: Setup node | |
uses: actions/setup-node@v5 | |
with: | |
node-version: 22 | |
cache: "yarn" | |
- name: Install Rust | |
uses: dtolnay/rust-toolchain@stable | |
with: | |
toolchain: nightly | |
components: rust-src | |
- name: Install dependencies | |
run: yarn install --immutable --mode=skip-build | |
- name: Download fixtures | |
run: node download-fixtures.js | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
- name: Test with ASAN | |
run: cargo test --tests --target x86_64-unknown-linux-gnu --features asan | |
env: | |
RUST_TARGET: x86_64-unknown-linux-gnu | |
RUST_BACKTRACE: 1 | |
RUSTFLAGS: "-Z${{ matrix.asan.flag }}" | |
ASAN_OPTIONS: ${{ matrix.asan.options }} | |
CARGO_UNSTABLE_BUILD_STD: std,panic_abort | |
asan-win32: | |
name: ASAN - Windows-x86_64 | |
runs-on: windows-latest | |
steps: | |
- uses: actions/checkout@v5 | |
- name: Setup node | |
uses: actions/setup-node@v5 | |
with: | |
node-version: 22 | |
cache: "yarn" | |
- name: Install Rust | |
uses: dtolnay/rust-toolchain@stable | |
with: | |
toolchain: nightly | |
components: rust-src | |
- name: Install dependencies | |
run: yarn install --immutable --mode=skip-build | |
- name: Download fixtures | |
run: node download-fixtures.js | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
- name: Test with ASAN (Windows) | |
shell: pwsh | |
run: | | |
# Set ASAN environment variables for Windows | |
$env:ASAN_OPTIONS = "windows_hook_rtl_allocators=true:detect_leaks=0:print_stats=1:check_initialization_order=true:strict_string_checks=true" | |
# Find and set the path to the ASAN runtime DLL | |
$vsPath = & "${env:ProgramFiles(x86)}\Microsoft Visual Studio\Installer\vswhere.exe" -latest -property installationPath | |
$asanDllPath = Get-ChildItem -Path "$vsPath\VC\Tools\MSVC" -Recurse -Filter "clang_rt.asan_dynamic-x86_64.dll" | Select-Object -First 1 | |
if ($asanDllPath) { | |
$env:PATH = "$($asanDllPath.DirectoryName);$env:PATH" | |
Write-Host "Found ASAN DLL at: $($asanDllPath.FullName)" | |
} | |
cargo test --tests --target x86_64-pc-windows-msvc | |
env: | |
RUSTFLAGS: -Zsanitizer=address | |
RUST_BACKTRACE: 1 | |
CARGO_PROFILE_DEV_OPT_LEVEL: 1 | |
CARGO_UNSTABLE_BUILD_STD: std,panic_abort | |
- name: Upload ASAN logs (Windows) | |
if: failure() | |
uses: actions/upload-artifact@v4 | |
with: | |
name: windows-asan-logs | |
path: | | |
asan.log* | |
*.asan.log | |
bench: | |
strategy: | |
matrix: | |
settings: | |
- target: x86_64-unknown-linux-gnu | |
os: ubuntu-latest | |
- target: x86_64-pc-windows-msvc | |
os: windows-latest | |
- target: aarch64-pc-windows-msvc | |
os: windows-11-arm | |
- target: aarch64-unknown-linux-gnu | |
os: ubuntu-24.04-arm | |
- target: aarch64-apple-darwin | |
os: macos-latest | |
fail-fast: false | |
runs-on: ${{ matrix.settings.os }} | |
steps: | |
- uses: actions/checkout@v5 | |
- name: Setup Rust | |
uses: dtolnay/rust-toolchain@stable | |
with: | |
targets: ${{ matrix.settings.target }} | |
- uses: actions/setup-node@v5 | |
with: | |
node-version: 22 | |
cache: "yarn" | |
- name: Install dependencies | |
run: yarn install | |
- name: Download fixtures | |
run: node download-fixtures.js | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
- name: Run benchmarks | |
run: cargo bench | |
env: | |
RUSTFLAGS: "-C target-cpu=native" | |
done: | |
runs-on: ubuntu-latest | |
needs: [test, miri, asan, asan-win32, bench] | |
steps: | |
- run: exit 1 | |
if: ${{ always() && (contains(needs.*.result, 'failure') || contains(needs.*.result, 'cancelled')) }} |