Skip to content

Format

Format #116

Workflow file for this run

name: FUZZ
on:
push:
branches:
- master
pull_request:
schedule:
- cron: '0 2 * * *' # run at 2 AM UTC
workflow_dispatch:
inputs:
fuzzseconds:
description: "How many seconds to run fuzzing"
required: false
default: "30"
env:
CARGO_TERM_COLOR: always
jobs:
fuzz:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/cache@v4
with:
path: |
~/.cargo/registry
~/.cargo/git
target
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.toml') }}
- uses: dtolnay/rust-toolchain@nightly
- name: Set seconds to run tests
id: fuzz_config
run: |
if [ "${{ github.event_name }}" = "schedule" ]; then
echo "fuzzseconds=600" >> "$GITHUB_OUTPUT"
elif [ "${{ github.event_name }}" = "workflow_dispatch" ]; then
val="${{ inputs.fuzzseconds }}"
if [ -z "$val" ]; then
val=30
fi
echo "fuzzseconds=$val" >> "$GITHUB_OUTPUT"
else
echo "fuzzseconds=30" >> "$GITHUB_OUTPUT"
fi
- name: Run tests
run: |
cargo install cargo-fuzz
cargo +nightly fuzz run static_vector -- -max_total_time=${{ steps.fuzz_config.outputs.fuzzseconds }}