name: Rust
on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]
env:
CARGO_TERM_COLOR: always
jobs:
fmt:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- run: rustup update
- run: rustup component add rustfmt
- run: cargo fmt --all --check
fuzz:
runs-on: ubuntu-latest
env:
CARGO_FUZZ_VERSION: 0.12.0
steps:
- uses: actions/checkout@v4
- run: rustup toolchain install nightly
- run: rustup default nightly
- uses: actions/cache@v4
with:
path: ${{ runner.tool_cache }}/cargo-fuzz
key: cargo-fuzz-bin-${{ env.CARGO_FUZZ_VERSION }}
- run: echo "${{ runner.tool_cache }}/cargo-fuzz/bin" >> $GITHUB_PATH
- run: cargo install --root "${{ runner.tool_cache }}/cargo-fuzz" --version ${{ env.CARGO_FUZZ_VERSION }} cargo-fuzz --locked
- run: cargo fuzz build ops
- run: RUST_LOG=trace cargo fuzz run ops -- -max_total_time=180 2> fuzz.log
- uses: actions/upload-artifact@v4
if: failure()
with:
name: fuzzing-artifacts-${{ github.sha }}
path: |
fuzz.log
fuzz/artifacts
fuzzing_crate:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- run: rustup toolchain install nightly
- run: rustup default nightly
- run: cargo test -p deallocate-zeroed-fuzzing
build:
runs-on: ubuntu-latest
strategy:
matrix:
include:
- features: "" rust_channel: stable
- features: "--no-default-features --features allocator_api2"
rust_channel: stable
- features: "--no-default-features --features allocator_api2,zero_aware_allocator"
rust_channel: stable
- features: "--no-default-features --features allocator_api"
rust_channel: nightly
- features: "--no-default-features --features allocator_api,zero_aware_allocator"
rust_channel: nightly
name: Test (${{ matrix.rust_channel }}; ${{ matrix.features }})
steps:
- uses: actions/checkout@v4
- run: rustup toolchain install ${{ matrix.rust_channel }}
- run: rustup default ${{ matrix.rust_channel }}
- run: cargo test --verbose ${{ matrix.features }}