name: Fuzz vs mgcv
on:
push:
branches: [main]
paths:
- "src/**"
- "bench/fuzz_vs_mgcv.py"
- "bench/run_suite.py"
- "tests/bench_fuzz_vs_mgcv_test.py"
- "Cargo.toml"
- "Cargo.lock"
- ".github/workflows/fuzz.yml"
- ".github/actions/setup-bench-r/**"
pull_request:
branches: [main]
paths:
- "src/**"
- "bench/fuzz_vs_mgcv.py"
- "bench/run_suite.py"
- "tests/bench_fuzz_vs_mgcv_test.py"
- "Cargo.toml"
- "Cargo.lock"
- ".github/workflows/fuzz.yml"
- ".github/actions/setup-bench-r/**"
workflow_dispatch:
concurrency:
group: fuzz-${{ github.ref }}
cancel-in-progress: true
permissions:
actions: read
contents: read
env:
CARGO_TERM_COLOR: always
jobs:
fuzz:
name: Fuzz vs mgcv
runs-on: ubuntu-latest
timeout-minutes: 60
steps:
- name: Checkout
uses: actions/checkout@v5
with:
fetch-depth: 1
- name: Install Rust stable
uses: dtolnay/rust-toolchain@stable
- name: Cache cargo artifacts
uses: Swatinem/rust-cache@v2
- name: Build release binary
run: cargo build --release --bin gam
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.11"
- name: Install Python deps
run: pip install numpy pandas scikit-learn lifelines
- name: Set up R
uses: ./.github/actions/setup-bench-r
with:
r-version: "4.4.3"
- name: Install R packages
run: Rscript -e 'install.packages(c("mgcv","jsonlite"), repos="https://cloud.r-project.org", Ncpus=max(1L, parallel::detectCores()-1L))'
- name: Run fuzzer
run: |
set -o pipefail
python bench/fuzz_vs_mgcv.py \
--n-trials 100 \
--top 30 \
--rust-timeout 60 \
--r-timeout 60 \
--max-scenario-cost 200000 \
--max-total-seconds 3300 \
2>&1 | tee fuzz_output.txt
- name: Upload fuzz results
if: always()
uses: actions/upload-artifact@v4
with:
name: fuzz-results
path: |
bench/fuzz_results.jsonl
fuzz_output.txt
if-no-files-found: warn