Skip to content

Commit 74fc85b

Browse files
committed
run py-fuzzer jobs on changes that affect py-fuzzer
1 parent 27e7a53 commit 74fc85b

File tree

1 file changed

+16
-4
lines changed

1 file changed

+16
-4
lines changed

.github/workflows/ci.yaml

Lines changed: 16 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,8 @@ jobs:
3838
fuzz: ${{ steps.check_fuzzer.outputs.changed }}
3939
# Flag that is set to "true" when code related to ty changes.
4040
ty: ${{ steps.check_ty.outputs.changed }}
41-
41+
# Flag that is set to "true" when code related to the py-fuzzer folder changes.
42+
py-fuzzer: ${{ steps.check_py_fuzzer.outputs.changed }}
4243
# Flag that is set to "true" when code related to the playground changes.
4344
playground: ${{ steps.check_playground.outputs.changed }}
4445
steps:
@@ -68,7 +69,6 @@ jobs:
6869
':crates/ruff_text_size/**' \
6970
':crates/ruff_python_ast/**' \
7071
':crates/ruff_python_parser/**' \
71-
':python/py-fuzzer/**' \
7272
':.github/workflows/ci.yaml' \
7373
; then
7474
echo "changed=false" >> "$GITHUB_OUTPUT"
@@ -138,6 +138,18 @@ jobs:
138138
echo "changed=true" >> "$GITHUB_OUTPUT"
139139
fi
140140
141+
- name: Check if the py-fuzzer code changed
142+
id: check_py_fuzzer
143+
env:
144+
MERGE_BASE: ${{ steps.merge_base.outputs.sha }}
145+
run: |
146+
if git diff --quiet "${MERGE_BASE}...HEAD" -- 'python/py_fuzzer/**' \
147+
; then
148+
echo "changed=false" >> "$GITHUB_OUTPUT"
149+
else
150+
echo "changed=true" >> "$GITHUB_OUTPUT"
151+
fi
152+
141153
- name: Check if there was any code related change
142154
id: check_code
143155
env:
@@ -443,7 +455,7 @@ jobs:
443455
needs:
444456
- cargo-test-linux
445457
- determine_changes
446-
if: ${{ !contains(github.event.pull_request.labels.*.name, 'no-test') && needs.determine_changes.outputs.parser == 'true' }}
458+
if: ${{ !contains(github.event.pull_request.labels.*.name, 'no-test') && (needs.determine_changes.outputs.parser == 'true' || needs.determine_changes.outputs.py-fuzzer == 'true') }}
447459
timeout-minutes: 20
448460
env:
449461
FORCE_COLOR: 1
@@ -633,7 +645,7 @@ jobs:
633645
- cargo-test-linux
634646
- determine_changes
635647
# Only runs on pull requests, since that is the only we way we can find the base version for comparison.
636-
if: ${{ !contains(github.event.pull_request.labels.*.name, 'no-test') && github.event_name == 'pull_request' && needs.determine_changes.outputs.ty == 'true' }}
648+
if: ${{ !contains(github.event.pull_request.labels.*.name, 'no-test') && github.event_name == 'pull_request' && (needs.determine_changes.outputs.ty == 'true' || needs.determine_changes.outputs.py-fuzzer == 'true') }}
637649
timeout-minutes: 20
638650
steps:
639651
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2

0 commit comments

Comments
 (0)