fix: Symlink handling in stream extraction #3491
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
name: CI | |
on: | |
pull_request: | |
branches: | |
- 'master' | |
push: | |
branches-ignore: | |
- 'gh-readonly-queue/**' | |
workflow_dispatch: | |
merge_group: | |
types: [checks_requested] | |
env: | |
RUSTFLAGS: -Dwarnings | |
jobs: | |
build_and_test: | |
if: github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name != github.event.pull_request.base.repo.full_name | |
strategy: | |
matrix: | |
os: [ubuntu-latest, macOS-latest, windows-latest] | |
rustalias: [stable, nightly, msrv] | |
feature_flag: ["--all-features", "--no-default-features", ""] | |
include: | |
- rustalias: stable | |
rust: stable | |
- rustalias: msrv | |
rust: '1.73' | |
- rustalias: nightly | |
rust: nightly | |
name: 'Build and test ${{ matrix.feature_flag }}: ${{ matrix.os }}, ${{ matrix.rustalias }}' | |
runs-on: ${{ matrix.os }} | |
steps: | |
- uses: actions/checkout@v4 | |
- run: rustup toolchain add ${{ matrix.rust }} && rustup default ${{ matrix.rust }} | |
- run: cargo check --all ${{ matrix.feature_flag }} --bins --examples | |
- run: cargo test --all ${{ matrix.feature_flag }} | |
cargo_fmt: | |
if: github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name != github.event.pull_request.base.repo.full_name | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- run: rustup toolchain add nightly && rustup default nightly && rustup component add rustfmt | |
- name: fmt | |
run: cargo fmt --all -- --check | |
- name: fmt fuzz_read | |
run: cargo fmt --manifest-path fuzz_read/Cargo.toml -- --check | |
- name: fmt fuzz_write | |
run: cargo fmt --manifest-path fuzz_write/Cargo.toml -- --check | |
check_minimal_versions: | |
if: github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name != github.event.pull_request.base.repo.full_name | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- run: rustup toolchain add nightly && rustup default nightly | |
- name: resolve minimal versions | |
run: cargo -Z minimal-versions update | |
- name: check | |
run: cargo check --all-features | |
- name: test | |
run: cargo test --all-features | |
style_and_docs: | |
if: github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name != github.event.pull_request.base.repo.full_name | |
strategy: | |
matrix: | |
feature_flag: ["--all-features", "--no-default-features", ""] | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- run: rustup toolchain add nightly && rustup default nightly && rustup component add clippy | |
- run: cargo clippy --all-targets ${{ matrix.feature_flag }} -- -D warnings | |
- run: cargo doc --no-deps ${{ matrix.feature_flag }} | |
fuzz_read: | |
runs-on: ubuntu-latest | |
needs: | |
- build_and_test | |
- cargo_fmt | |
- style_and_docs | |
steps: | |
- uses: actions/checkout@v4 | |
- run: rustup toolchain add nightly && rustup default nightly && rustup component add clippy | |
- run: cargo install cargo-afl | |
- name: cargo afl system-config | |
run: cargo afl system-config | |
- name: clippy | |
run: cargo afl clippy --all-features --manifest-path ${{ github.workspace }}/fuzz_read/Cargo.toml -- -D warnings | |
- name: compile fuzz | |
run: cargo afl build --all-features --manifest-path ${{ github.workspace }}/fuzz_read/Cargo.toml | |
- name: run fuzz | |
timeout-minutes: 70 | |
run: cargo afl fuzz -i ${{ github.workspace }}/fuzz_read/in -o out -V 3600 -- ${{ github.workspace }}/fuzz_read/target/debug/fuzz_read | |
- name: Minimize corpus | |
run: cargo afl cmin -i out/default/queue -o out_cmin -- ${{ github.workspace }}/fuzz_read/target/debug/fuzz_read | |
- name: Report coverage | |
run: cargo afl showmap -C -i out -o map -- ${{ github.workspace }}/fuzz_read/target/debug/fuzz_read | |
- run: sudo apt install rename | |
- name: Rename files | |
run: | | |
rename 's/:/-/g' map/* | |
rename 's/:/-/g' out_cmin/* | |
rename 's/:/-/g' out/default/crashes/* | |
- name: Upload updated corpus | |
uses: actions/upload-artifact@v4 | |
with: | |
name: fuzz_read_corpus | |
path: out_cmin/* | |
- name: Upload any failure inputs | |
if: always() | |
uses: actions/upload-artifact@v4 | |
with: | |
name: fuzz_read_bad_inputs | |
path: out/default/crashes/* | |
if-no-files-found: ignore | |
- name: Upload coverage report | |
if: always() | |
uses: actions/upload-artifact@v4 | |
with: | |
name: fuzz_read_coverage | |
path: map | |
fuzz_read_with_no_features: | |
runs-on: ubuntu-latest | |
needs: | |
- build_and_test | |
- cargo_fmt | |
- style_and_docs | |
steps: | |
- uses: actions/checkout@v4 | |
- run: rustup toolchain add nightly && rustup default nightly && rustup component add clippy | |
- run: cargo install cargo-afl | |
- name: cargo afl system-config | |
run: cargo afl system-config | |
- name: clippy | |
run: cargo afl clippy --no-default-features --manifest-path ${{ github.workspace }}/fuzz_read/Cargo.toml -- -D warnings | |
- name: compile fuzz | |
run: cargo afl build --manifest-path ${{ github.workspace }}/fuzz_read/Cargo.toml | |
- name: run fuzz | |
timeout-minutes: 70 | |
run: cargo afl fuzz -i ${{ github.workspace }}/fuzz_read/in -o out -V 3600 -- ${{ github.workspace }}/fuzz_read/target/debug/fuzz_read | |
- name: Report coverage | |
run: cargo afl showmap -C -i out -o map -- ${{ github.workspace }}/fuzz_read/target/debug/fuzz_read | |
- run: sudo apt install rename | |
- name: Rename files | |
run: | | |
rename 's/:/-/g' map/* | |
rename 's/:/-/g' out/default/crashes/* | |
- name: Upload any failure inputs | |
if: always() | |
uses: actions/upload-artifact@v4 | |
with: | |
name: fuzz_read_bad_inputs_no_features | |
path: out/default/crashes/* | |
if-no-files-found: ignore | |
- name: Upload coverage report | |
if: always() | |
uses: actions/upload-artifact@v4 | |
with: | |
name: fuzz_read_coverage_no_features | |
path: map | |
fuzz_write: | |
runs-on: ubuntu-latest | |
needs: | |
- build_and_test | |
- cargo_fmt | |
- style_and_docs | |
steps: | |
- uses: actions/checkout@v4 | |
- run: rustup toolchain add nightly && rustup default nightly && rustup component add clippy | |
- run: cargo install cargo-afl | |
- name: cargo afl system-config | |
run: cargo afl system-config | |
- name: clippy | |
run: cargo afl clippy --all-features --manifest-path ${{ github.workspace }}/fuzz_write/Cargo.toml -- -D warnings | |
- name: compile fuzz | |
run: cargo afl build --all-features --manifest-path ${{ github.workspace }}/fuzz_write/Cargo.toml | |
- name: run fuzz | |
timeout-minutes: 70 | |
run: cargo afl fuzz -i ${{ github.workspace }}/fuzz_write/in -o out -V 3600 -x ${{ github.workspace }}/fuzz_write/fuzz.dict -- ${{ github.workspace }}/fuzz_write/target/debug/fuzz_write | |
- name: Minimize corpus | |
run: cargo afl cmin -i out/default/queue -o out_cmin -- ${{ github.workspace }}/fuzz_write/target/debug/fuzz_write | |
- name: Report coverage | |
run: cargo afl showmap -C -i out -o map -- ${{ github.workspace }}/fuzz_write/target/debug/fuzz_write | |
- run: sudo apt install rename | |
- name: Rename files | |
run: | | |
rename 's/:/-/g' map/* | |
rename 's/:/-/g' out_cmin/* | |
rename 's/:/-/g' out/default/crashes/* | |
- name: Upload updated corpus | |
uses: actions/upload-artifact@v4 | |
with: | |
name: fuzz_write_corpus | |
path: out_cmin/* | |
- name: Upload any failure inputs | |
if: always() | |
uses: actions/upload-artifact@v4 | |
with: | |
name: fuzz_write_bad_inputs | |
path: out/default/crashes/* | |
if-no-files-found: ignore | |
- name: Upload coverage report | |
if: always() | |
uses: actions/upload-artifact@v4 | |
with: | |
name: fuzz_write_coverage | |
path: map | |
fuzz_write_with_no_features: | |
runs-on: ubuntu-latest | |
needs: | |
- build_and_test | |
- cargo_fmt | |
- style_and_docs | |
steps: | |
- uses: actions/checkout@v4 | |
- run: rustup toolchain add nightly && rustup default nightly && rustup component add clippy | |
- run: cargo install cargo-afl | |
- name: cargo afl system-config | |
run: cargo afl system-config | |
- name: clippy | |
run: cargo afl clippy --no-default-features --manifest-path ${{ github.workspace }}/fuzz_write/Cargo.toml -- -D warnings | |
- name: compile fuzz | |
run: cargo afl build --all-features --manifest-path ${{ github.workspace }}/fuzz_write/Cargo.toml | |
- name: run fuzz | |
timeout-minutes: 70 | |
run: cargo afl fuzz -i ${{ github.workspace }}/fuzz_write/in -o out -V 3600 -x ${{ github.workspace }}/fuzz_write/fuzz.dict -- ${{ github.workspace }}/fuzz_write/target/debug/fuzz_write | |
- name: Report coverage | |
run: cargo afl showmap -C -i out -o map -- ${{ github.workspace }}/fuzz_write/target/debug/fuzz_write | |
- run: sudo apt install rename | |
- name: Rename files | |
run: | | |
rename 's/:/-/g' map/* | |
rename 's/:/-/g' out/default/crashes/* | |
- name: Upload any failure inputs | |
if: always() | |
uses: actions/upload-artifact@v4 | |
with: | |
name: fuzz_write_bad_inputs_no_features | |
path: out/default/crashes/* | |
if-no-files-found: ignore | |
- name: Upload coverage report | |
if: always() | |
uses: actions/upload-artifact@v4 | |
with: | |
name: fuzz_write_coverage_no_features | |
path: map |