Perform fuzz testing on pull request 7879 by pavoljuhas #53
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: CIFuzz | |
| run-name: >- | |
| Perform fuzz testing on pull request ${{github.event.pull_request.number}} | |
| by ${{github.actor}} | |
| on: | |
| pull_request: | |
| branches: | |
| - main | |
| paths: | |
| - 'cirq-*/**' | |
| workflow_dispatch: | |
| permissions: {} | |
| concurrency: | |
| # Cancel any previously-started but still active runs on the same branch. | |
| cancel-in-progress: true | |
| group: ${{github.workflow}}-${{github.event.pull_request.number||github.ref}} | |
| jobs: | |
| fuzzing: | |
| name: Fuzz testing | |
| if: github.repository_owner == 'quantumlib' | |
| runs-on: ubuntu-24.04-x64-16-core | |
| permissions: | |
| security-events: write | |
| steps: | |
| - name: Checkout Code | |
| uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 | |
| - name: Cache build artifacts | |
| uses: actions/cache@cdf6c1fa76f9f475f3d7449005a359c84ca0f306 # v5.0.3 | |
| with: | |
| path: ~/.cache/pip | |
| key: ${{runner.os}}-cifuzz-${{hashFiles('cirq-*/**/requirements.txt')}} | |
| restore-keys: ${{runner.os}}-cifuzz- | |
| - name: Build Fuzzers | |
| id: build | |
| uses: google/oss-fuzz/infra/cifuzz/actions/build_fuzzers@master | |
| with: | |
| oss-fuzz-project-name: cirq | |
| language: python | |
| - name: Run Fuzzers | |
| uses: google/oss-fuzz/infra/cifuzz/actions/run_fuzzers@master | |
| with: | |
| oss-fuzz-project-name: cirq | |
| language: python | |
| fuzz-seconds: 300 | |
| output-sarif: true | |
| parallel-fuzzing: true | |
| - name: Upload artifacts to workflow page if a failure occurred | |
| uses: actions/upload-artifact@b7c566a772e6b6bfb58ed0dc250532a479d7789f # v6.0.0 | |
| if: failure() && steps.build.outcome == 'success' | |
| with: | |
| name: artifacts | |
| path: ./out/artifacts | |
| - name: Upload SARIF file to results page | |
| if: always() && steps.build.outcome == 'success' | |
| uses: github/codeql-action/upload-sarif@25a224b8085c21d4d61b7fc051468805fc3ac490 # codeql-bundle-v2.24.0 | |
| with: | |
| # This the output SARIF file path generated by the 'run_fuzzers' action. | |
| sarif_file: cifuzz-sarif/results.sarif |