Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Standardise workflow variables:
* Rename `config_hash` to `config-hash`
* Rename `run_tests` to `run-tests`
* Rename `run-win-msi` to `run-windows-msi`
* Rename `run_hypothesis` to `run-hypothesis`
* Rename `run_cifuzz` to `run-ci-fuzz`
  • Loading branch information
AA-Turner committed Feb 4, 2025
commit 49f02be2a35085e1e3a867251e44688c18af2c84
54 changes: 27 additions & 27 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ jobs:
# if: fromJSON(needs.check_source.outputs.run-docs)
#
# ${{
# fromJSON(needs.check_source.outputs.run_tests)
# fromJSON(needs.check_source.outputs.run-tests)
# && 'truthy-branch'
# || 'falsy-branch'
# }}
Expand All @@ -52,7 +52,7 @@ jobs:
image: ghcr.io/python/autoconf:2025.01.02.12581854023
timeout-minutes: 60
needs: check_source
if: needs.check_source.outputs.run_tests == 'true'
if: needs.check_source.outputs.run-tests == 'true'
steps:
- name: Install Git
run: |
Expand Down Expand Up @@ -95,7 +95,7 @@ jobs:
runs-on: ubuntu-24.04
timeout-minutes: 60
needs: check_source
if: needs.check_source.outputs.run_tests == 'true'
if: needs.check_source.outputs.run-tests == 'true'
steps:
- uses: actions/checkout@v4
with:
Expand All @@ -110,7 +110,7 @@ jobs:
with:
path: config.cache
# Include env.pythonLocation in key to avoid changes in environment when setup-python updates Python
key: ${{ github.job }}-${{ runner.os }}-${{ env.IMAGE_VERSION }}-${{ needs.check_source.outputs.config_hash }}-${{ env.pythonLocation }}
key: ${{ github.job }}-${{ runner.os }}-${{ env.IMAGE_VERSION }}-${{ needs.check_source.outputs.config-hash }}-${{ env.pythonLocation }}
- name: Install Dependencies
run: sudo ./.github/workflows/posix-deps-apt.sh
- name: Add ccache to PATH
Expand Down Expand Up @@ -154,7 +154,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)
strategy:
fail-fast: false
matrix:
Expand Down Expand Up @@ -185,7 +185,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-windows-msi)
strategy:
matrix:
arch:
Expand All @@ -201,7 +201,7 @@ jobs:
macOS
${{ fromJSON(matrix.free-threading) && '(free-threading)' || '' }}
needs: check_source
if: needs.check_source.outputs.run_tests == 'true'
if: needs.check_source.outputs.run-tests == 'true'
strategy:
fail-fast: false
matrix:
Expand All @@ -226,7 +226,7 @@ jobs:
free-threading: true
uses: ./.github/workflows/reusable-macos.yml
with:
config_hash: ${{ needs.check_source.outputs.config_hash }}
config_hash: ${{ needs.check_source.outputs.config-hash }}
free-threading: ${{ matrix.free-threading }}
os: ${{ matrix.os }}

Expand All @@ -236,7 +236,7 @@ jobs:
${{ fromJSON(matrix.free-threading) && '(free-threading)' || '' }}
${{ fromJSON(matrix.bolt) && '(bolt)' || '' }}
needs: check_source
if: needs.check_source.outputs.run_tests == 'true'
if: needs.check_source.outputs.run-tests == 'true'
strategy:
matrix:
bolt:
Expand All @@ -257,7 +257,7 @@ jobs:
bolt: true
uses: ./.github/workflows/reusable-ubuntu.yml
with:
config_hash: ${{ needs.check_source.outputs.config_hash }}
config_hash: ${{ needs.check_source.outputs.config-hash }}
bolt-optimizations: ${{ matrix.bolt }}
free-threading: ${{ matrix.free-threading }}
os: ${{ matrix.os }}
Expand All @@ -267,7 +267,7 @@ jobs:
runs-on: ${{ matrix.os }}
timeout-minutes: 60
needs: check_source
if: needs.check_source.outputs.run_tests == 'true'
if: needs.check_source.outputs.run-tests == 'true'
strategy:
fail-fast: false
matrix:
Expand All @@ -289,7 +289,7 @@ jobs:
uses: actions/cache@v4
with:
path: config.cache
key: ${{ github.job }}-${{ runner.os }}-${{ env.IMAGE_VERSION }}-${{ needs.check_source.outputs.config_hash }}
key: ${{ github.job }}-${{ runner.os }}-${{ env.IMAGE_VERSION }}-${{ needs.check_source.outputs.config-hash }}
- name: Register gcc problem matcher
run: echo "::add-matcher::.github/problem-matchers/gcc.json"
- name: Install Dependencies
Expand Down Expand Up @@ -327,17 +327,17 @@ jobs:
build_wasi:
name: 'WASI'
needs: check_source
if: needs.check_source.outputs.run_tests == 'true'
if: needs.check_source.outputs.run-tests == 'true'
uses: ./.github/workflows/reusable-wasi.yml
with:
config_hash: ${{ needs.check_source.outputs.config_hash }}
config_hash: ${{ needs.check_source.outputs.config-hash }}

test_hypothesis:
name: "Hypothesis tests on Ubuntu"
runs-on: ubuntu-24.04
timeout-minutes: 60
needs: check_source
if: needs.check_source.outputs.run_tests == 'true' && needs.check_source.outputs.run_hypothesis == 'true'
if: needs.check_source.outputs.run-tests == 'true' && needs.check_source.outputs.run-hypothesis == 'true'
env:
OPENSSL_VER: 3.0.15
PYTHONSTRICTEXTENSIONBUILD: 1
Expand Down Expand Up @@ -384,7 +384,7 @@ jobs:
uses: actions/cache@v4
with:
path: ${{ env.CPYTHON_BUILDDIR }}/config.cache
key: ${{ github.job }}-${{ runner.os }}-${{ env.IMAGE_VERSION }}-${{ needs.check_source.outputs.config_hash }}
key: ${{ github.job }}-${{ runner.os }}-${{ env.IMAGE_VERSION }}-${{ needs.check_source.outputs.config-hash }}
- name: Configure CPython out-of-tree
working-directory: ${{ env.CPYTHON_BUILDDIR }}
run: |
Expand Down Expand Up @@ -453,7 +453,7 @@ jobs:
runs-on: ${{ matrix.os }}
timeout-minutes: 60
needs: check_source
if: needs.check_source.outputs.run_tests == 'true'
if: needs.check_source.outputs.run-tests == 'true'
strategy:
matrix:
os: [ubuntu-24.04]
Expand All @@ -471,7 +471,7 @@ jobs:
uses: actions/cache@v4
with:
path: config.cache
key: ${{ github.job }}-${{ runner.os }}-${{ env.IMAGE_VERSION }}-${{ needs.check_source.outputs.config_hash }}
key: ${{ github.job }}-${{ runner.os }}-${{ env.IMAGE_VERSION }}-${{ needs.check_source.outputs.config-hash }}
- name: Register gcc problem matcher
run: echo "::add-matcher::.github/problem-matchers/gcc.json"
- name: Install Dependencies
Expand Down Expand Up @@ -516,22 +516,22 @@ jobs:
Thread sanitizer
${{ fromJSON(matrix.free-threading) && '(free-threading)' || '' }}
needs: check_source
if: needs.check_source.outputs.run_tests == 'true'
if: needs.check_source.outputs.run-tests == 'true'
strategy:
matrix:
free-threading:
- false
- true
uses: ./.github/workflows/reusable-tsan.yml
with:
config_hash: ${{ needs.check_source.outputs.config_hash }}
config_hash: ${{ needs.check_source.outputs.config-hash }}
free-threading: ${{ matrix.free-threading }}

cross-build-linux:
name: Cross build Linux
runs-on: ubuntu-latest
needs: check_source
if: needs.check_source.outputs.run_tests == 'true'
if: needs.check_source.outputs.run-tests == 'true'
steps:
- uses: actions/checkout@v4
with:
Expand All @@ -542,7 +542,7 @@ jobs:
uses: actions/cache@v4
with:
path: config.cache
key: ${{ github.job }}-${{ runner.os }}-${{ env.IMAGE_VERSION }}-${{ needs.check_source.outputs.config_hash }}
key: ${{ github.job }}-${{ runner.os }}-${{ env.IMAGE_VERSION }}-${{ needs.check_source.outputs.config-hash }}
- name: Register gcc problem matcher
run: echo "::add-matcher::.github/problem-matchers/gcc.json"
- name: Set build dir
Expand Down Expand Up @@ -572,7 +572,7 @@ jobs:
runs-on: ubuntu-latest
timeout-minutes: 60
needs: check_source
if: needs.check_source.outputs.run_cifuzz == 'true'
if: needs.check_source.outputs.run-ci-fuzz == 'true'
permissions:
security-events: write
strategy:
Expand Down Expand Up @@ -611,7 +611,7 @@ jobs:
if: always()

needs:
- check_source # Transitive dependency, needed to access `run_tests` value
- check_source # Transitive dependency, needed to access `run-tests` value
- check-docs
- check_autoconf_regen
- check_generated_files
Expand Down Expand Up @@ -646,7 +646,7 @@ jobs:
|| ''
}}
${{
needs.check_source.outputs.run_tests != 'true'
needs.check_source.outputs.run-tests != 'true'
&& '
check_autoconf_regen,
check_generated_files,
Expand All @@ -661,14 +661,14 @@ jobs:
|| ''
}}
${{
!fromJSON(needs.check_source.outputs.run_cifuzz)
!fromJSON(needs.check_source.outputs.run-ci-fuzz)
&& '
cifuzz,
'
|| ''
}}
${{
!fromJSON(needs.check_source.outputs.run_hypothesis)
!fromJSON(needs.check_source.outputs.run-hypothesis)
&& '
test_hypothesis,
'
Expand Down
20 changes: 10 additions & 10 deletions .github/workflows/reusable-change-detection.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,27 +23,27 @@ on: # yamllint disable-line rule:truthy
# || 'falsy-branch'
# }}
#
config_hash:
config-hash:
description: Config hash value for use in cache keys
value: ${{ jobs.compute-changes.outputs.config-hash }} # str
run-docs:
description: Whether to build the docs
value: ${{ jobs.compute-changes.outputs.run-docs || false }} # bool
run_tests:
run-tests:
description: Whether to run the regular tests
value: ${{ jobs.compute-changes.outputs.run-tests || false }} # bool
run-win-msi:
run-windows-msi:
description: Whether to run the MSI installer smoke tests
value: >- # bool
${{ jobs.compute-changes.outputs.run-win-msi || false }}
run_hypothesis:
${{ jobs.compute-changes.outputs.run-windows-msi || false }} # bool
run-hypothesis:
description: Whether to run the Hypothesis tests
value: >- # bool
${{ jobs.compute-changes.outputs.run-hypothesis || false }}
run_cifuzz:
${{ jobs.compute-changes.outputs.run-hypothesis || false }} # bool
run-ci-fuzz:
description: Whether to run the CIFuzz job
value: >- # bool
${{ jobs.compute-changes.outputs.run-cifuzz || false }}
${{ jobs.compute-changes.outputs.run-ci-fuzz || false }} # bool

jobs:
compute-changes:
Expand All @@ -52,11 +52,11 @@ jobs:
timeout-minutes: 10
outputs:
config-hash: ${{ steps.config-hash.outputs.hash }}
run-cifuzz: ${{ steps.changes.outputs.run-cifuzz }}
run-ci-fuzz: ${{ steps.changes.outputs.run-ci-fuzz }}
run-docs: ${{ steps.changes.outputs.run-docs }}
run-hypothesis: ${{ steps.changes.outputs.run-hypothesis }}
run-tests: ${{ steps.changes.outputs.run-tests }}
run-win-msi: ${{ steps.changes.outputs.run-win-msi }}
run-windows-msi: ${{ steps.changes.outputs.run-windows-msi }}
steps:
- uses: actions/setup-python@v5
with:
Expand Down
4 changes: 2 additions & 2 deletions Tools/build/compute-changes.py
Original file line number Diff line number Diff line change
Expand Up @@ -180,11 +180,11 @@ def write_github_output(outputs: Outputs) -> None:
return

with open(os.environ["GITHUB_OUTPUT"], "a", encoding="utf-8") as f:
f.write(f"run-cifuzz={bool_lower(outputs.run_ci_fuzz)}\n")
f.write(f"run-ci-fuzz={bool_lower(outputs.run_ci_fuzz)}\n")
f.write(f"run-docs={bool_lower(outputs.run_docs)}\n")
f.write(f"run-hypothesis={bool_lower(outputs.run_hypothesis)}\n")
f.write(f"run-tests={bool_lower(outputs.run_tests)}\n")
f.write(f"run-win-msi={bool_lower(outputs.run_windows_msi)}\n")
f.write(f"run-windows-msi={bool_lower(outputs.run_windows_msi)}\n")


def bool_lower(value: bool, /) -> str:
Expand Down
Loading