Skip to content

cli: Add support for webpsan #182

cli: Add support for webpsan

cli: Add support for webpsan #182

Workflow file for this run

name: test
on: [push]
defaults:
run:
shell: bash
jobs:
format-check:
name: format-check
runs-on: ubuntu-latest
steps:
- name: checkout
uses: actions/checkout@v3
- name: cargo fmt --check
run: cargo fmt --check
build-and-test:
name: build-and-test
runs-on: ubuntu-latest
env:
TEST_DATA_SSH_KEY: ${{ secrets.TEST_DATA_SSH_KEY }}
steps:
- name: checkout
uses: actions/checkout@v3
- name: checkout test-data submodule
continue-on-error: true
if: ${{ env.TEST_DATA_SSH_KEY != '' }}
env:
SSH_KEY: ${{ env.TEST_DATA_SSH_KEY }}
run: |
eval `ssh-agent`
ssh-add - <<< "${SSH_KEY}"
git submodule update --init --checkout test-data
- name: cache cargo output
uses: actions/cache@v3
with:
path: |
~/.cargo/registry/index/
~/.cargo/registry/cache/
~/.cargo/git/db/
target/
key: ${{ runner.os }}-cargo-${{ hashFiles('Cargo.lock') }}
- name: cargo check
run: cargo check --verbose
- name: cargo build
run: cargo build --verbose
- name: install libav libraries for ffmpeg tests
run: sudo apt-get install --no-install-recommends -y libavcodec-dev libavformat-dev libavutil-dev libswresample-dev libswscale-dev
- name: install gpac libraries for gpac tests
run: |
wget https://download.tsi.telecom-paristech.fr/gpac/release/2.2/gpac_2.2-rev0-gab012bbf-master_amd64.deb
sudo apt-get install ./gpac_2.2-rev0-gab012bbf-master_amd64.deb
wget https://download.tsi.telecom-paristech.fr/gpac/release/2.2/libgpac-dev_2.2-rev0-gab012bbf-master_amd64.deb
sudo apt-get install ./libgpac-dev_2.2-rev0-gab012bbf-master_amd64.deb
- name: cargo test -- --skip test_data
run: cargo test --verbose --features mp4san-test/ffmpeg,mp4san-test/gpac,webpsan-test/libwebp -- --skip test_data
- name: cargo test test_data
continue-on-error: true
if: ${{ env.TEST_DATA_SSH_KEY != '' }}
run: cargo test --verbose --features mp4san-test/ffmpeg,mp4san-test/gpac,webpsan-test/libwebp test_data -- --show-output
- name: cargo clippy
uses: actions-rs/clippy-check@v1
with:
token: ${{ github.token }}
fuzz-afl:
name: fuzz-afl
runs-on: ubuntu-latest
steps:
- name: checkout
uses: actions/checkout@v3
- name: cache cargo output
uses: actions/cache@v3
with:
path: |
~/.cargo/registry/index/
~/.cargo/registry/cache/
~/.cargo/git/db/
target/
key: ${{ runner.os }}-cargo-afl-${{ hashFiles('Cargo.lock') }}
- name: cargo install cargo-afl
run: cargo install cargo-afl --verbose
- name: fuzz mp4san for 10 seconds
run: cd mp4san/fuzz-afl && AFL_I_DONT_CARE_ABOUT_MISSING_CRASHES=1 ./fuzz -V 10
- name: fuzz webpsan for 10 seconds
run: cd webpsan/fuzz-afl && AFL_I_DONT_CARE_ABOUT_MISSING_CRASHES=1 ./fuzz -V 10
fuzz-libfuzzer:
name: fuzz-libfuzzer
runs-on: ubuntu-latest
steps:
- name: checkout
uses: actions/checkout@v3
- name: install latest rust nightly toolchain
uses: actions-rs/toolchain@v1
with:
toolchain: nightly
- name: cache cargo output
uses: actions/cache@v3
with:
path: |
~/.cargo/registry/index/
~/.cargo/registry/cache/
~/.cargo/git/db/
target/
key: ${{ runner.os }}-cargo-libfuzzer-${{ hashFiles('Cargo.lock') }}
- name: cargo install cargo-fuzz
run: cargo install cargo-fuzz --verbose
- name: fuzz mp4san for 10 seconds
run: cd mp4san && cargo +nightly fuzz run sanitize -- -seed_inputs=$(find fuzz/input/ -type f | tr '\n' ,) -dict=fuzz/mp4.dict -max_total_time=10
- name: fuzz webpsan for 10 seconds
run: cd webpsan && cargo +nightly fuzz run sanitize -- -seed_inputs=$(find fuzz/input/ -type f | tr '\n' ,) -dict=fuzz/webp.dict -max_total_time=10
build-nightly:
name: check-nightly
runs-on: ubuntu-latest
steps:
- name: checkout
uses: actions/checkout@v3
- name: install latest rust nightly toolchain
uses: actions-rs/toolchain@v1
with:
toolchain: nightly
- name: cache cargo output
uses: actions/cache@v3
with:
path: |
~/.cargo/registry/index/
~/.cargo/registry/cache/
~/.cargo/git/db/
target/
key: ${{ runner.os }}-cargo-nightly-${{ hashFiles('Cargo.lock') }}
- name: cargo +nightly check
run: cargo +nightly check --verbose