Secondary architectures (s390x, ppc64le, powerpc64, mips, alpha, sparc64) run
monthly and on demand on ubuntu-24.04 instead of on every push: mips has no
cross toolchain in Ubuntu 26.04 at all, and the rest exercise the gmp/mpfr
source build path. They are not obsolete, so they keep running through the
same reusable workflow.
Build (all arches) is manual only and calls the primary and secondary groups
in a single run.
Signed-off-by: Dave Young <yangrr.2009(a)tsinghua.org.cn>
Assisted-by: LLM
Signed-off-by: Dave Young <yangrr.2009(a)tsinghua.org.cn>
---
.github/workflows/ci-build-all.yml | 30 ++++++++++
.github/workflows/ci-build-secondary.yml | 73 ++++++++++++++++++++++++
2 files changed, 103 insertions(+)
create mode 100644 .github/workflows/ci-build-all.yml
create mode 100644 .github/workflows/ci-build-secondary.yml
diff --git a/.github/workflows/ci-build-all.yml b/.github/workflows/ci-build-all.yml
new file mode 100644
index 000000000000..39c9fffdd831
--- /dev/null
+++ b/.github/workflows/ci-build-all.yml
@@ -0,0 +1,30 @@
+name: Build (all arches)
+
+# Manual only: builds the primary and secondary arch groups in a single run.
+# Pushes already build the primary group, and the secondary group has its own
+# monthly schedule, so this workflow has no trigger of its own besides dispatch.
+on:
+ workflow_dispatch:
+ inputs:
+ groups:
+ description: 'Arch groups to build'
+ type: choice
+ default: both
+ options:
+ - both
+ - primary
+ - secondary
+
+permissions:
+ contents: read
+
+jobs:
+ primary:
+ name: Primary group
+ if: inputs.groups == 'both' || inputs.groups == 'primary'
+ uses: ./.github/workflows/ci-build.yml
+
+ secondary:
+ name: Secondary group
+ if: inputs.groups == 'both' || inputs.groups == 'secondary'
+ uses: ./.github/workflows/ci-build-secondary.yml
diff --git a/.github/workflows/ci-build-secondary.yml
b/.github/workflows/ci-build-secondary.yml
new file mode 100644
index 000000000000..263476a9800c
--- /dev/null
+++ b/.github/workflows/ci-build-secondary.yml
@@ -0,0 +1,73 @@
+name: Build (secondary)
+
+# Secondary architectures: not built on every push, but run monthly and on
+# demand, all on the 24.04 image: mips has no cross toolchain in Ubuntu 26.04 at
+# all. s390x and ppc64le have archive packages for the target gmp/mpfr;
+# powerpc64, mips, alpha and sparc64 build them from source.
+# Dispatch with an "arches" list to build a subset, or run
+# "CI build (one arch)" for a single architecture.
+on:
+ schedule:
+ - cron: '10 2 1 * *'
+ workflow_dispatch:
+ inputs:
+ arches:
+ description: 'Comma-separated subset (empty = all): s390x powerpc64le
powerpc64 mips alpha sparc64'
+ required: false
+ default: ''
+ workflow_call:
+ inputs:
+ arches:
+ description: 'Comma-separated subset (empty = all)'
+ required: false
+ type: string
+ default: ''
+
+permissions:
+ contents: read
+
+jobs:
+ plan:
+ name: Plan
+ runs-on: ubuntu-latest
+ timeout-minutes: 5
+ outputs:
+ matrix: ${{ steps.select.outputs.matrix }}
+ steps:
+ - name: Select arches
+ id: select
+ env:
+ ALL_ARCHES: s390x powerpc64le powerpc64 mips alpha sparc64
+ REQUESTED: ${{ inputs.arches }}
+ run: |
+ set -eu
+ if [ -z "$REQUESTED" ]; then
+ selected=$ALL_ARCHES
+ else
+ selected=
+ for arch in $(echo "$REQUESTED" | tr ',' ' '); do
+ case " $ALL_ARCHES " in
+ *" $arch "*) selected="$selected $arch" ;;
+ *) echo "Unknown architecture '$arch'; valid:
$ALL_ARCHES" >&2
+ exit 1 ;;
+ esac
+ done
+ fi
+ if [ -z "${selected// /}" ]; then
+ echo "No architectures selected" >&2
+ exit 1
+ fi
+ matrix=$(printf '%s\n' $selected | jq -R . | jq -s -c '{arch:
.}')
+ echo "matrix=$matrix"
+ echo "matrix=$matrix" >> "$GITHUB_OUTPUT"
+
+ build:
+ name: ${{ matrix.arch }}
+ needs: plan
+ strategy:
+ fail-fast: false
+ matrix: ${{ fromJson(needs.plan.outputs.matrix) }}
+ uses: ./.github/workflows/ci-arch-build.yml
+ with:
+ arch: ${{ matrix.arch }}
+ runner: ubuntu-24.04
--
2.51.1