Dispatching "Build" or "Build (secondary)" from the Actions page only
offered a
free-form "arches" text field. Add an "arch" choice input (all, or a
single
architecture) so an arch can be picked from a dropdown, and keep the text field
as an optional override for subsets.
The per-arch workflow ("CI build (one arch)") already has arch/runner
dropdowns of its own.
Signed-off-by: Dave Young <yangrr.2009(a)tsinghua.org.cn>
Assisted-by: LLM
---
.github/workflows/ci-build-secondary.yml | 27 ++++++++++++++++++++++--
.github/workflows/ci-build.yml | 26 +++++++++++++++++++++--
2 files changed, 49 insertions(+), 4 deletions(-)
diff --git a/.github/workflows/ci-build-secondary.yml
b/.github/workflows/ci-build-secondary.yml
index 263476a9800c..34a3cb3c272e 100644
--- a/.github/workflows/ci-build-secondary.yml
+++ b/.github/workflows/ci-build-secondary.yml
@@ -11,6 +11,19 @@ on:
- cron: '10 2 1 * *'
workflow_dispatch:
inputs:
+ arch:
+ description: 'Architecture to build (all = the whole group)'
+ type: choice
+ default: all
+ options:
+ - all
+ - s390x
+ - powerpc64le
+ - powerpc64
+ - mips
+ - alpha
+ - sparc64
+ # optional comma-separated subset, overrides the dropdown above
arches:
description: 'Comma-separated subset (empty = all): s390x powerpc64le
powerpc64 mips alpha sparc64'
required: false
@@ -39,13 +52,23 @@ jobs:
env:
ALL_ARCHES: s390x powerpc64le powerpc64 mips alpha sparc64
REQUESTED: ${{ inputs.arches }}
+ SINGLE: ${{ inputs.arch }}
run: |
set -eu
- if [ -z "$REQUESTED" ]; then
+ # the dropdown picks one arch; "all" (or an explicit list) keeps the
+ # whole group
+ if [ -n "${REQUESTED:-}" ]; then
+ wanted=$REQUESTED
+ elif [ -n "${SINGLE:-}" ] && [ "$SINGLE" != all ];
then
+ wanted=$SINGLE
+ else
+ wanted=
+ fi
+ if [ -z "$wanted" ]; then
selected=$ALL_ARCHES
else
selected=
- for arch in $(echo "$REQUESTED" | tr ',' ' '); do
+ for arch in $(echo "$wanted" | tr ',' ' '); do
case " $ALL_ARCHES " in
*" $arch "*) selected="$selected $arch" ;;
*) echo "Unknown architecture '$arch'; valid:
$ALL_ARCHES" >&2
diff --git a/.github/workflows/ci-build.yml b/.github/workflows/ci-build.yml
index d94f5562710a..bdf076bcac85 100644
--- a/.github/workflows/ci-build.yml
+++ b/.github/workflows/ci-build.yml
@@ -10,6 +10,18 @@ on:
branches: [ master ]
workflow_dispatch:
inputs:
+ arch:
+ description: 'Architecture to build (all = the whole group)'
+ type: choice
+ default: all
+ options:
+ - all
+ - x86_64
+ - x86
+ - aarch64
+ - riscv64
+ - loongarch64
+ # optional comma-separated subset, overrides the dropdown above
arches:
description: 'Comma-separated subset (empty = all): x86_64 x86 aarch64
riscv64 loongarch64'
required: false
@@ -38,13 +50,23 @@ jobs:
env:
ALL_ARCHES: x86_64 x86 aarch64 riscv64 loongarch64
REQUESTED: ${{ inputs.arches }}
+ SINGLE: ${{ inputs.arch }}
run: |
set -eu
- if [ -z "$REQUESTED" ]; then
+ # the dropdown picks one arch; "all" (or an explicit list) keeps the
+ # whole group
+ if [ -n "${REQUESTED:-}" ]; then
+ wanted=$REQUESTED
+ elif [ -n "${SINGLE:-}" ] && [ "$SINGLE" != all ];
then
+ wanted=$SINGLE
+ else
+ wanted=
+ fi
+ if [ -z "$wanted" ]; then
selected=$ALL_ARCHES
else
selected=
- for arch in $(echo "$REQUESTED" | tr ',' ' '); do
+ for arch in $(echo "$wanted" | tr ',' ' '); do
case " $ALL_ARCHES " in
*" $arch "*) selected="$selected $arch" ;;
*) echo "Unknown architecture '$arch'; valid:
$ALL_ARCHES" >&2
--
2.51.1