| 1 |
name: Fuzzing |
| 2 |
|
| 3 |
env: |
| 4 |
|
| 5 |
|
| 6 |
PY_COLORS: 1 |
| 7 |
|
| 8 |
on: |
| 9 |
|
| 10 |
schedule: |
| 11 |
- cron: '0 */6 * * *' |
| 12 |
|
| 13 |
workflow_dispatch: |
| 14 |
|
| 15 |
|
| 16 |
|
| 17 |
|
| 18 |
jobs: |
| 19 |
fuzz: |
| 20 |
if: github.repository == 'HypothesisWorks/hypothesis' || github.event_name == 'workflow_dispatch' |
| 21 |
|
| 22 |
runs-on: ubuntu-latest |
| 23 |
steps: |
| 24 |
- uses: actions/checkout@v3 |
| 25 |
with: |
| 26 |
fetch-depth: 0 |
| 27 |
- name: Set up Python 3.14 |
| 28 |
uses: actions/setup-python@v4 |
| 29 |
with: |
| 30 |
python-version: "3.14.2" |
| 31 |
- name: Restore cache |
| 32 |
uses: actions/cache@v3 |
| 33 |
with: |
| 34 |
path: | |
| 35 |
~/.cache |
| 36 |
~/wheelhouse |
| 37 |
~/.local |
| 38 |
vendor/bundle |
| 39 |
.tox/ |
| 40 |
key: deps-${{ runner.os }}-${{ hashFiles('requirements/*.txt') }}-${{ matrix.task }} |
| 41 |
restore-keys: | |
| 42 |
deps-${{ runner.os }}-${{ hashFiles('requirements/*.txt') }} |
| 43 |
deps-${{ runner.os }} |
| 44 |
|
| 45 |
|
| 46 |
|
| 47 |
|
| 48 |
|
| 49 |
|
| 50 |
- name: Download example database |
| 51 |
uses: dawidd6/action-download-artifact@v9 |
| 52 |
with: |
| 53 |
name: hypothesis-example-db |
| 54 |
path: .hypothesis/examples |
| 55 |
if_no_artifact_found: warn |
| 56 |
workflow_conclusion: completed |
| 57 |
|
| 58 |
- name: Install dependencies |
| 59 |
run: | |
| 60 |
pip install --upgrade setuptools pip wheel |
| 61 |
pip install -r requirements/fuzzing.txt |
| 62 |
pip install hypothesis-python/[all] |
| 63 |
|
| 64 |
- name: Run hypofuzz session |
| 65 |
continue-on-error: true |
| 66 |
|
| 67 |
|
| 68 |
|
| 69 |
|
| 70 |
run: | |
| 71 |
timeout --preserve-status 5.5h \ |
| 72 |
hypothesis fuzz -- hypothesis-python/tests/ \ |
| 73 |
--ignore=hypothesis-python/tests/quality/ \ |
| 74 |
--ignore=hypothesis-python/tests/ghostwriter/ |
| 75 |
|
| 76 |
- name: Upload patch files with covering and failing `@example()`s |
| 77 |
uses: actions/upload-artifact@v4 |
| 78 |
if: always() |
| 79 |
with: |
| 80 |
name: explicit-example-patches |
| 81 |
path: .hypothesis/patches/latest_hypofuzz_*.patch |
| 82 |
|
| 83 |
|
| 84 |
|
| 85 |
|
| 86 |
- name: Upload example database |
| 87 |
uses: actions/upload-artifact@v4 |
| 88 |
if: always() |
| 89 |
with: |
| 90 |
name: hypothesis-example-db |
| 91 |
path: .hypothesis/examples |