fix(ci): skip QC gate when v4 dataset absent (gitignored artefact) #170
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Property-Based Fuzz Testing | |
| # Runs the Hypothesis property-based test suite against SESTRAV's core functions. | |
| # This satisfies the Scorecard Fuzzing check (PythonAtherisFuzzer or property-based | |
| # testing integration): https://scorecard.dev/checks/#fuzzing | |
| # | |
| # Tests are in tests/test_fuzz.py and exercise compute_features and get_tcr_positions | |
| # under adversarial/edge-case inputs using Hypothesis. | |
| on: | |
| push: | |
| branches: [main] | |
| pull_request: | |
| branches: [main] | |
| schedule: | |
| # Weekly extended fuzz run (Saturday 02:00 UTC) with higher max_examples | |
| - cron: '0 2 * * 6' | |
| permissions: read-all | |
| jobs: | |
| fuzz: | |
| name: Hypothesis Property-Based Fuzzing | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0 | |
| - name: Set up Python | |
| uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0 | |
| with: | |
| python-version: '3.13' | |
| - name: Install CPU PyTorch (no CUDA needed for fuzz tests) | |
| run: pip install torch==2.12.0 --index-url https://download.pytorch.org/whl/cpu | |
| - name: Install dependencies | |
| run: | | |
| pip install --no-deps --require-hashes -r requirements.txt | |
| pip install --no-deps --require-hashes -r environments/requirements-ci.txt | |
| - name: Run Hypothesis fuzz tests | |
| # HYPOTHESIS_MAX_EXAMPLES controls depth; 200 on push, 1000 on schedule | |
| env: | |
| HYPOTHESIS_MAX_EXAMPLES: ${{ github.event_name == 'schedule' && '1000' || '200' }} | |
| run: | | |
| python -m pytest tests/test_fuzz.py -v \ | |
| --tb=short \ | |
| -p hypothesis \ | |
| --hypothesis-seed=0 | |
| - name: Upload Hypothesis database (persists failure examples between runs) | |
| if: always() | |
| uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 | |
| with: | |
| name: hypothesis-database | |
| path: .hypothesis/ | |
| retention-days: 30 |