Use libafl as libfuzzer for fuzzing #2530
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
on: | |
push: | |
branches: | |
- master | |
pull_request: | |
branches: | |
- master | |
schedule: [cron: "40 1 * * *"] | |
name: ci | |
jobs: | |
# build on backhand only supported target | |
cross-build: | |
runs-on: ${{ matrix.job.os }} | |
env: | |
BUILD_CMD: cargo | |
strategy: | |
fail-fast: false | |
matrix: | |
job: | |
- { target: x86_64-pc-windows-gnu, os: ubuntu-latest, use-cross: true } | |
toolchain: | |
- stable | |
# msrv of backhand-cli | |
- 1.77.0 | |
features: | |
- --no-default-features --features xz | |
- --no-default-features --features gzip | |
- --no-default-features --features gzip,xz | |
- --no-default-features --features xz-static | |
- --no-default-features --features gzip-zune-inflate | |
# default features | |
- | |
steps: | |
- uses: actions/checkout@a5ac7e51b41094c92402da3b24376905380afc29 # v4.1.6 | |
- name: Populate cache | |
uses: ./.github/workflows/cache | |
- name: Overwrite build command env variable | |
if: matrix.job.use-cross | |
shell: bash | |
run: | | |
echo "BUILD_CMD=cross" >> $GITHUB_ENV | |
RUSTFLAGS="-C target-feature=-crt-static" cargo install cross --git https://github.com/cross-rs/cross | |
- uses: dtolnay/rust-toolchain@master | |
with: | |
toolchain: ${{ matrix.toolchain }} | |
# build lib with cross | |
- run: $BUILD_CMD build ${{ matrix.features }} --target ${{ matrix.job.target }} --release --locked --workspace --lib | |
# build/test all supported targets for library and bins (skipping slow and squashfs-tools tests) | |
cross-test: | |
runs-on: ${{ matrix.job.os }} | |
env: | |
RUSTFLAGS: "-C target-feature=+crt-static" | |
BUILD_CMD: cargo | |
strategy: | |
fail-fast: false | |
matrix: | |
job: | |
- { target: x86_64-unknown-linux-musl, os: ubuntu-latest, use-cross: true } | |
- { target: aarch64-unknown-linux-musl, os: ubuntu-latest, use-cross: true } | |
- { target: arm-unknown-linux-musleabi, os: ubuntu-latest, use-cross: true } | |
- { target: armv7-unknown-linux-musleabi, os: ubuntu-latest, use-cross: true } | |
- { target: aarch64-unknown-linux-musl, os: ubuntu-latest, use-cross: true } | |
- { target: x86_64-apple-darwin, os: macos-12 } | |
toolchain: | |
- stable | |
# msrv of backhand-cli | |
- 1.77.0 | |
features: | |
# default features | |
- | |
steps: | |
- uses: actions/checkout@a5ac7e51b41094c92402da3b24376905380afc29 # v4.1.6 | |
- name: Populate cache | |
uses: ./.github/workflows/cache | |
- name: Overwrite build command env variable | |
if: matrix.job.use-cross | |
shell: bash | |
run: | | |
echo "BUILD_CMD=cross" >> $GITHUB_ENV | |
RUSTFLAGS="-C target-feature=-crt-static" cargo install cross --git https://github.com/cross-rs/cross | |
- uses: dtolnay/rust-toolchain@master | |
with: | |
toolchain: ${{ matrix.toolchain }} | |
# build lib and bins with cross | |
- run: $BUILD_CMD build ${{ matrix.features }} --target ${{ matrix.job.target }} --release --locked --workspace --features xz-static | |
# test with cross, skipping slow test and tests that use more then qemu default memory | |
- run: CROSS_CONTAINER_OPTS="--network host" RUST_LOG=info $BUILD_CMD test --workspace --release ${{ matrix.features }} --target ${{ matrix.job.target }} --features xz-static --locked -- --skip slow --skip no_qemu | |
# build/test all supported on native x86_64 arch for library and bins (all tests) | |
build-test-native: | |
runs-on: ubuntu-latest | |
strategy: | |
fail-fast: false | |
matrix: | |
toolchain: | |
- stable | |
# msrv of backhand-cli | |
- 1.77.0 | |
features: | |
- --no-default-features --features xz | |
- --no-default-features --features gzip | |
- --no-default-features --features gzip,xz | |
- --no-default-features --features xz-static | |
- --no-default-features --features gzip-zune-inflate | |
# default features | |
- | |
steps: | |
- run: sudo apt-get install -y squashfs-tools | |
- uses: actions/checkout@a5ac7e51b41094c92402da3b24376905380afc29 # v4.1.6 | |
- uses: dtolnay/rust-toolchain@d8352f6b1d2e870bc5716e7a6d9b65c4cc244a1a # master | |
with: | |
toolchain: ${{ matrix.toolchain }} | |
# build bins | |
- run: cargo build ${{ matrix.features }} --release --locked --workspace | |
# run tests with native unsquashfs on x86_64-unknown-linux-musl (using Cross.toml) | |
- run: RUST_LOG=info cargo test --workspace --release ${{ matrix.features }} --locked --features __test_unsquashfs -- --skip slow | |
# fmt and clippy on stable | |
fmt-clippy-stable: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@a5ac7e51b41094c92402da3b24376905380afc29 # v4.1.6 | |
- uses: dtolnay/rust-toolchain@d8352f6b1d2e870bc5716e7a6d9b65c4cc244a1a # master | |
with: | |
toolchain: stable | |
components: rustfmt, clippy | |
# fmt | |
- run: cargo fmt --all -- --check | |
# clippy | |
- run: cargo clippy -- -D warnings |