Skip to content

Commit 6334287

Browse files
committed
ci(prepare-images): respect disable-build-* PR labels
Plumb the disable-build-<platform> labels (already resolved into build_enable_<platform> outputs in config.yml) through to the prepare-images workflow so it skips image builds the PR has opted out of. Mapping (label → skipped): - disable-build-ubuntu-x64 → ubuntu22/x64, ubuntu24/x64 - disable-build-ubuntu-arm64 → ubuntu22/arm64, ubuntu24/arm64 - disable-build-emscripten → emscripten/arm64 - disable-build-linux-vcpkg → rockylinux8-vcpkg/{x64,arm64} - disable-build-windows → vs2019, vs2022 vcpkg cache builds Avoids burning runner time producing images no downstream build job will consume.
1 parent 5f0ded7 commit 6334287

2 files changed

Lines changed: 32 additions & 3 deletions

File tree

.github/workflows/build-test-distribute.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,11 @@ jobs:
4545
vcpkg_docker_image_tag: ${{ needs.config.outputs.vcpkg_docker_image_tag }}
4646
vs19_vcpkg_version: ${{ needs.config.outputs.vs19_vcpkg_version }}
4747
vs22_vcpkg_version: ${{ needs.config.outputs.vs22_vcpkg_version }}
48+
disable_ubuntu_x64: ${{ needs.config.outputs.build_enable_ubuntu_x64 != 'true' }}
49+
disable_ubuntu_arm64: ${{ needs.config.outputs.build_enable_ubuntu_arm64 != 'true' }}
50+
disable_emscripten: ${{ needs.config.outputs.build_enable_emscripten != 'true' }}
51+
disable_linux_vcpkg: ${{ needs.config.outputs.build_enable_linux_vcpkg != 'true' }}
52+
disable_windows: ${{ needs.config.outputs.build_enable_windows != 'true' }}
4853
secrets: inherit
4954

5055
versioning-and-release-url:

.github/workflows/prepare-images.yml

Lines changed: 27 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,24 @@ on:
2424
vs22_vcpkg_version:
2525
required: true
2626
type: string
27+
# `disable-build-<platform>` PR labels (resolved upstream in
28+
# config.yml) — skip the matching image build cells / jobs so we
29+
# don't burn runner time producing images no consumer will use.
30+
disable_ubuntu_x64:
31+
type: boolean
32+
default: false
33+
disable_ubuntu_arm64:
34+
type: boolean
35+
default: false
36+
disable_emscripten:
37+
type: boolean
38+
default: false
39+
disable_linux_vcpkg:
40+
type: boolean
41+
default: false
42+
disable_windows:
43+
type: boolean
44+
default: false
2745

2846
# Allows you to run this workflow manually from the Actions tab
2947
workflow_dispatch:
@@ -36,7 +54,13 @@ jobs:
3654
run: echo
3755

3856
linux-image-build-upload:
39-
if: ${{ inputs.need_linux_image_rebuild }}
57+
# Skip per-cell when the disable-build-<platform> label for this
58+
# (distro, arch) is set — see workflow_call inputs above.
59+
if: >-
60+
${{ inputs.need_linux_image_rebuild
61+
&& !(matrix.distro == 'emscripten' && inputs.disable_emscripten)
62+
&& !(startsWith(matrix.distro, 'ubuntu') && matrix.arch == 'x64' && inputs.disable_ubuntu_x64)
63+
&& !(startsWith(matrix.distro, 'ubuntu') && matrix.arch == 'arm64' && inputs.disable_ubuntu_arm64) }}
4064
timeout-minutes: 75
4165
strategy:
4266
fail-fast: false
@@ -102,7 +126,7 @@ jobs:
102126
run: docker system prune --force --all --volumes
103127

104128
linux-vcpkg-build-upload:
105-
if: ${{ inputs.need_linux_vcpkg_rebuild }}
129+
if: ${{ inputs.need_linux_vcpkg_rebuild && !inputs.disable_linux_vcpkg }}
106130
timeout-minutes: 75
107131
strategy:
108132
fail-fast: false
@@ -141,7 +165,7 @@ jobs:
141165
run: docker system prune --force --all --volumes
142166

143167
windows-vcpkg-build-upload:
144-
if: ${{ inputs.need_windows_vcpkg_rebuild }}
168+
if: ${{ inputs.need_windows_vcpkg_rebuild && !inputs.disable_windows }}
145169
timeout-minutes: 240
146170
runs-on: ${{ matrix.runner }}
147171
strategy:

0 commit comments

Comments
 (0)