diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 9adf860632e8a2..aec50c5200d1c6 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -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: @@ -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: diff --git a/.github/workflows/reusable-change-detection.yml b/.github/workflows/reusable-change-detection.yml index 964bd87e815f42..1a1f9eff5867cd 100644 --- a/.github/workflows/reusable-change-detection.yml +++ b/.github/workflows/reusable-change-detection.yml @@ -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 @@ -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 }}' @@ -111,6 +116,20 @@ jobs: echo "Branch too old for CIFuzz tests; or no C files were changed" echo "run-cifuzz=false" >> "$GITHUB_OUTPUT" fi + + if [ "$GITHUB_BASE_REF" = "main" ]; then + CHANGED_FILES=$(git diff --name-only "origin/$GITHUB_BASE_REF..") + # Check if changes are ONLY in configure/Makefile files + if echo "$CHANGED_FILES" | grep -qE '^(configure.*|Makefile.*|.*\.m4)$' && \ + ! echo "$CHANGED_FILES" | grep -qvE '^(configure.*|Makefile.*|.*\.m4)$'; then + # Only configure/Makefile files changed, skip Windows CI + echo "run-windows=false" >> "$GITHUB_OUTPUT" + else + # Other files changed, run Windows CI + echo "run-windows=true" >> "$GITHUB_OUTPUT" + fi + fi + - name: Compute hash for config cache key id: config-hash run: | diff --git a/Lib/random.py b/Lib/random.py index 8b9a270c429e4a..e902a9baeddba7 100644 --- a/Lib/random.py +++ b/Lib/random.py @@ -1,4 +1,4 @@ -"""Random variable generators. +"""Random variable generators! bytes -----