Debian Codegraph @

.github/workflows/fuzz.yml

raw symbols SCIP
1 name: Fuzzing
2
3 env:
4 # Tell pytest and other tools to produce coloured terminal output.
5 # Make sure this is also in the "passenv" section of the tox config.
6 PY_COLORS: 1
7
8 on:
9 # Run every six hours, for six hours each time
10 schedule:
11 - cron: '0 */6 * * *'
12 # Allow manual launching too so we can test any branch we like
13 workflow_dispatch:
14 # # Enable this and reduce the timeout below to check a PR is working
15 # pull_request:
16 # branches: [ master ]
17
18 jobs:
19 fuzz:
20 if: github.repository == 'HypothesisWorks/hypothesis' || github.event_name == 'workflow_dispatch'
21 # Keep all of this stuff synced with the setup in main.yml for CI
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 # OK, on to the fuzzing-specific part.
46 # We're going to stick everything into a single run for now instead of
47 # sharding it, because we'd have to manually specify all the databases
48 # we want to multiplex across and that would be annoying to manage.
49 # TODO: revisit this later; a redis-like service would be so much nicer.
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 # The timeout ensures that we finish all steps within the six-hour
67 # maximum runtime for Github Actions.
68 # Then run the fuzzer on everything, as for our Windows CI; avoiding
69 # the --no-dashboard option because that also disables .patch writing.
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 # Upload the database so it'll be persisted between runs.
84 # Note that we can also pull it down to use locally via
85 # https://hypothesis.readthedocs.io/en/latest/database.html#hypothesis.database.GitHubArtifactDatabase
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