-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add a new CI job to fuzz the parser (#11089)
- Loading branch information
1 parent
38d2562
commit f5c7a62
Showing
2 changed files
with
50 additions
and
2 deletions.
There are no files selected for viewing
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -23,6 +23,8 @@ jobs: | |
name: "Determine changes" | ||
runs-on: ubuntu-latest | ||
outputs: | ||
# Flag that is raised when any code that affects parser is changed | ||
parser: ${{ steps.changed.outputs.parser_any_changed }} | ||
# Flag that is raised when any code that affects linter is changed | ||
linter: ${{ steps.changed.outputs.linter_any_changed }} | ||
# Flag that is raised when any code that affects formatter is changed | ||
|
@@ -39,6 +41,17 @@ jobs: | |
id: changed | ||
with: | ||
files_yaml: | | ||
parser: | ||
- Cargo.toml | ||
- Cargo.lock | ||
- crates/ruff_python_trivia/** | ||
- crates/ruff_source_file/** | ||
- crates/ruff_text_size/** | ||
- crates/ruff_python_ast/** | ||
- crates/ruff_python_parser/** | ||
- scripts/fuzz-parser/** | ||
- .github/workflows/ci.yaml | ||
linter: | ||
- Cargo.toml | ||
- Cargo.lock | ||
|
@@ -200,6 +213,38 @@ jobs: | |
tool: [email protected] | ||
- run: cargo fuzz build -s none | ||
|
||
fuzz-parser: | ||
name: "Fuzz the parser" | ||
runs-on: ubuntu-latest | ||
needs: | ||
- cargo-test-linux | ||
- determine_changes | ||
if: ${{ needs.determine_changes.outputs.parser == 'true' }} | ||
timeout-minutes: 20 | ||
env: | ||
FORCE_COLOR: 1 | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: actions/setup-python@v5 | ||
with: | ||
python-version: ${{ env.PYTHON_VERSION }} | ||
- name: Install uv | ||
run: curl -LsSf https://astral.sh/uv/install.sh | sh | ||
- name: Install Python requirements | ||
run: uv pip install -r scripts/fuzz-parser/requirements.txt --system | ||
- uses: actions/download-artifact@v4 | ||
name: Download Ruff binary to test | ||
id: download-cached-binary | ||
with: | ||
name: ruff | ||
path: ruff-to-test | ||
- name: Fuzz | ||
run: | | ||
# Make executable, since artifact download doesn't preserve this | ||
chmod +x ${{ steps.download-cached-binary.outputs.download-path }}/ruff | ||
python scripts/fuzz-parser/fuzz.py 0-500 --test-executable ${{ steps.download-cached-binary.outputs.download-path }}/ruff | ||
scripts: | ||
name: "test scripts" | ||
runs-on: ubuntu-latest | ||
|
This file contains 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