Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 8 additions & 2 deletions .github/scripts/run_long_fuzzers.sh
Original file line number Diff line number Diff line change
Expand Up @@ -68,8 +68,14 @@ while IFS= read -r fuzz_bin; do
if [[ -n "$FUZZ_DURATION" ]]; then
cmd+=("--fuzz_for=${FUZZ_DURATION}")
fi
env_vars=()
if [[ -n "$CORPUS_DIR" ]]; then
cmd+=("--corpus_database=${CORPUS_DIR}")
fuzz_corpus_dir="${CORPUS_DIR}/${fuzz_name}"
mkdir -p "$fuzz_corpus_dir"
env_vars+=(
"FUZZTEST_TESTSUITE_OUT_DIR=${fuzz_corpus_dir}"
"FUZZTEST_TESTSUITE_IN_DIR=${fuzz_corpus_dir}"
)
fi
"${cmd[@]}" | tee "$LOG_DIR/${fuzz_name}.log"
env "${env_vars[@]}" "${cmd[@]}" 2>&1 | tee "$LOG_DIR/${fuzz_name}.log" || true
done <<< "$FUZZ_BINS"
50 changes: 42 additions & 8 deletions .github/workflows/nightly-long-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,12 @@ name: Nightly Long Tests

on:
schedule:
- cron: "0 0 * * *"
- cron: '0 7 * * *' # midnight MDT (07:00 UTC)
workflow_dispatch:
inputs:
fuzz_duration:
description: 'Duration per fuzz target (e.g. 120s, 10m)'
default: '600s'

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
Expand All @@ -27,11 +31,11 @@ jobs:
packages: write
actions: read
steps:
- uses: actions/checkout@v4
- uses: actions/checkout@v6

- name: Restore fuzz corpus cache
id: fuzz-corpus-cache
uses: actions/cache/restore@v4
uses: actions/cache/restore@v5
with:
path: .fuzztest_corpus
key: fuzz-corpus-${{ runner.os }}-${{ github.run_id }}
Expand Down Expand Up @@ -126,29 +130,59 @@ jobs:
ASAN_OPTIONS: detect_leaks=1:strict_string_checks=1:check_initialization_order=1
UBSAN_OPTIONS: halt_on_error=1:print_stacktrace=1:suppressions=/dev/null
run: |
FUZZ_DURATION="${{ inputs.fuzz_duration || '600s' }}"
"${GITHUB_WORKSPACE}/.github/scripts/run_long_fuzzers.sh" "$(pwd)" "${GITHUB_WORKSPACE}/fuzz-logs" \
--fuzz-for 600s \
--fuzz-for "$FUZZ_DURATION" \
--corpus "${XMERA_FUZZTEST_CORPUS_DIR}"

- name: Generate fuzz report summary
if: ${{ always() }}
run: |
{
echo "## Nightly Fuzz Report — $(date -u +%Y-%m-%d)"
echo ""
echo "| Target | Corpus Files | Status |"
echo "|--------|-------------|--------|"

for log in fuzz-logs/*.log; do
[[ -f "$log" ]] || continue
name="$(basename "$log" .log)"

corpus_count=0
if [[ -d ".fuzztest_corpus" ]]; then
corpus_count=$(find ".fuzztest_corpus" -type f -path "*${name}*" 2>/dev/null | wc -l || echo 0)
fi

if grep -qiE '(SUMMARY:.*Sanitizer|crash-|==ERROR)' "$log" 2>/dev/null; then
status="CRASH"
else
status="OK"
fi

echo "| ${name} | ${corpus_count} | ${status} |"
done
} >> "$GITHUB_STEP_SUMMARY"

- name: Archive fuzz logs
if: ${{ always() }}
uses: actions/upload-artifact@v4
uses: actions/upload-artifact@v7
with:
name: fuzz-logs
path: fuzz-logs
retention-days: 7

- name: Upload fuzz corpus artifact
if: ${{ always() }}
uses: actions/upload-artifact@v4
uses: actions/upload-artifact@v7
with:
name: fuzz-corpus-${{ github.run_id }}
path: .fuzztest_corpus
path: ${{ github.workspace }}/.fuzztest_corpus/
include-hidden-files: true
retention-days: 7

- name: Save fuzz corpus cache
if: ${{ always() }}
uses: actions/cache/save@v4
uses: actions/cache/save@v5
with:
path: .fuzztest_corpus
key: fuzz-corpus-${{ runner.os }}-${{ github.run_id }}
Loading
Loading