Skip to content

Commit

Permalink
pythongh-128446: Skip Windows CI for configure/Makefile changes
Browse files Browse the repository at this point in the history
  • Loading branch information
srinivasreddy committed Jan 3, 2025
1 parent f21af18 commit d1f2c08
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 2 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ jobs:
Windows
${{ fromJSON(matrix.free-threading) && '(free-threading)' || '' }}
needs: check_source
if: fromJSON(needs.check_source.outputs.run_tests)
if: fromJSON(needs.check_source.outputs.run_tests) && fromJSON(needs.check_source.outputs.run-windows)
strategy:
fail-fast: false
matrix:
Expand Down Expand Up @@ -182,7 +182,7 @@ jobs:
name: >- # ${{ '' } is a hack to nest jobs under the same sidebar category
Windows MSI${{ '' }}
needs: check_source
if: fromJSON(needs.check_source.outputs.run-win-msi)
if: fromJSON(needs.check_source.outputs.run-win-msi) && fromJSON(needs.check_source.outputs.run-windows)
strategy:
matrix:
arch:
Expand Down
22 changes: 22 additions & 0 deletions .github/workflows/reusable-change-detection.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,10 @@ on: # yamllint disable-line rule:truthy
description: Whether to run the MSI installer smoke tests
value: >- # bool
${{ jobs.compute-changes.outputs.run-win-msi || false }}
run-windows:
description: Whether to run the Windows CI
value: >- # bool
${{ jobs.compute-changes.outputs.run-windows || false }}
run_hypothesis:
description: Whether to run the Hypothesis tests
value: >- # bool
Expand All @@ -57,6 +61,7 @@ jobs:
run-hypothesis: ${{ steps.check.outputs.run-hypothesis }}
run-tests: ${{ steps.check.outputs.run-tests }}
run-win-msi: ${{ steps.win-msi-changes.outputs.run-win-msi }}
run-windows: ${{ steps.check.outputs.run-windows }}
steps:
- run: >-
echo '${{ github.event_name }}'
Expand Down Expand Up @@ -111,6 +116,23 @@ jobs:
echo "Branch too old for CIFuzz tests; or no C files were changed"
echo "run-cifuzz=false" >> "$GITHUB_OUTPUT"
fi
# Check if changes are Windows-specific
if [ -z "$GITHUB_BASE_REF" ]; then
echo "run-windows=true" >> "$GITHUB_OUTPUT"
else
# Get changed files
CHANGED_FILES=$(git diff --name-only "origin/$GITHUB_BASE_REF..")
# Check if changes are only in configure/Makefile files
if echo "$CHANGED_FILES" | grep -qvE '^(configure.*|Makefile.*|.*\.m4)$'; then
# Other files changed, run Windows CI
echo "run-windows=true" >> "$GITHUB_OUTPUT"
else
# Only configure/Makefile files changed, skip Windows CI
echo "run-windows=false" >> "$GITHUB_OUTPUT"
fi
fi
- name: Compute hash for config cache key
id: config-hash
run: |
Expand Down

0 comments on commit d1f2c08

Please sign in to comment.