2021-04-14 10:39:53 -04:00
|
|
|
name: Fuzz
|
|
|
|
|
|
|
|
on:
|
|
|
|
create:
|
|
|
|
tags:
|
|
|
|
- 'v*'
|
|
|
|
repository_dispatch:
|
|
|
|
types: [wf-fuzz]
|
|
|
|
|
|
|
|
jobs:
|
2021-04-14 10:41:27 -04:00
|
|
|
fuzz:
|
2021-04-14 10:39:53 -04:00
|
|
|
runs-on: ubuntu-18.04
|
|
|
|
steps:
|
|
|
|
- uses: actions/checkout@v1
|
|
|
|
|
|
|
|
- name: Set up Rust
|
|
|
|
uses: actions-rs/toolchain@v1
|
|
|
|
with:
|
|
|
|
toolchain: stable
|
|
|
|
profile: minimal
|
|
|
|
default: true
|
|
|
|
|
|
|
|
- name: Set up Go
|
|
|
|
uses: actions/setup-go@v2
|
|
|
|
with:
|
|
|
|
go-version: '^1.14.0'
|
|
|
|
|
|
|
|
- name: Run prebuild steps
|
|
|
|
shell: bash
|
|
|
|
run: bash ./prebuild.sh
|
|
|
|
|
|
|
|
- name: Build fuzz target
|
|
|
|
working-directory: ./fuzz
|
|
|
|
run: |
|
2021-04-14 10:41:27 -04:00
|
|
|
cargo install afl
|
2021-04-14 10:39:53 -04:00
|
|
|
cargo afl build
|
|
|
|
|
|
|
|
- name: Run fuzz
|
|
|
|
working-directory: ./fuzz
|
|
|
|
run: |
|
2021-04-14 11:19:19 -04:00
|
|
|
echo core | sudo tee /proc/sys/kernel/core_pattern
|
2021-04-15 00:15:58 -04:00
|
|
|
# Hide verbose stdout (not stderr) logging.
|
|
|
|
timeout 5h cargo afl fuzz -i in -o out target/debug/minify-html-fuzz-target > /dev/null || true
|
2021-04-15 06:12:06 -04:00
|
|
|
find ./out/crashes -type f | wc -l
|
2021-04-14 10:39:53 -04:00
|
|
|
|
|
|
|
- name: Set up Backblaze B2 CLI
|
|
|
|
uses: wilsonzlin/setup-b2@v3
|
|
|
|
|
|
|
|
- name: Upload log and output files
|
|
|
|
working-directory: ./fuzz
|
|
|
|
run: |
|
2021-04-15 22:19:47 -04:00
|
|
|
if [ -d ./out/crashes ]; then
|
|
|
|
b2 authorize-account ${{ secrets.CICD_CLI_B2_KEY_ID }} ${{ secrets.CICD_CLI_B2_APPLICATION_KEY }}
|
|
|
|
b2 sync --allowEmptySource ./out/crashes/ b2://${{ secrets.CICD_CLI_B2_BUCKET_NAME }}/minify-html/fuzz/$(git rev-parse --short HEAD)/crashes/
|
|
|
|
fi
|