From a1389b839361b6d730763052393fe38d92bf93b5 Mon Sep 17 00:00:00 2001 From: Nemo <328747105+Nemo-010@users.noreply.github.com> Date: Fri, 23 Oct 2026 00:08:23 +0000 Subject: [PATCH] build demos on riscv64, loongarch64, ppc64le and ppc64 A build-additional-cpu-arches matrix builds the gtk3, gtk4, sdl and vkcube+glxgears demos for the four newer arches through qemu user emulation, and runs them. The binfmt handlers are registered before the container starts, with the script of anylinux-setup-action, because docker/setup-qemu-action ships no ppc64 (BE) handler. The release job waits for that matrix with the same !cancelled() guard as the template, so a disabled matrix does not block a release. ppc64le, loongarch64 and riscv64 do have vulkan drivers in their repos, we just do not bundle them, so vkcube works there and only BE ppc64 makes glxgears its main binary. vulkan-swrast is installed for the test on every arch, it is packaged for powerpc64 too. The sdl demo keeps plain sdl2, which sdl2-compat provides on riscv64 and loongarch64. --- .github/workflows/build-demos.yml | 53 ++++++++++++++++++- useful-tools/demo/vkcube-glxgears-appimage.sh | 4 ++ 2 files changed, 55 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build-demos.yml b/.github/workflows/build-demos.yml index 7322b6e3..1965bcd0 100644 --- a/.github/workflows/build-demos.yml +++ b/.github/workflows/build-demos.yml @@ -106,9 +106,58 @@ jobs: name: AppImage-${{ matrix.arch }}-${{ matrix.script }} path: dist + # these run through qemu user emulation, so expect much longer CI times + build-additional-cpu-arches: + name: "${{ matrix.script }} (${{ matrix.arch }})" + runs-on: ubuntu-24.04 + strategy: + fail-fast: false + matrix: + script: + - vkcube-glxgears-appimage + - gtk3-demo-appimage + - gtk4-demo-appimage + - sdl-demo-appimage + arch: [riscv64, loongarch64, ppc64le, ppc64] + include: + - { arch: riscv64, platform: linux/riscv64 } + - { arch: loongarch64, platform: linux/loong64 } + - { arch: ppc64le, platform: linux/ppc64le } + - { arch: ppc64, platform: linux/ppc64 } # BE + steps: + - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 + + # the binfmt handlers must exist before the foreign arch container starts + # so this cannot use a job level container. The script of the setup action + # is reused because docker/setup-qemu-action ships no ppc64 (BE) handler + - name: Register QEMU binfmt handlers + run: | + curl -fsSL -o ./register-binfmt.sh \ + https://raw.githubusercontent.com/pkgforge-dev/anylinux-setup-action/ba7321e11074f9e387a0634e653d09b115d576cd/emulated/register-binfmt.sh + sh ./register-binfmt.sh + + - name: Make AppImage (emulated) + env: + PLATFORM: ${{ matrix.platform }} + run: | + docker run --rm --platform "$PLATFORM" \ + -e GITHUB_REPOSITORY \ + -v "$PWD":/repo -w /repo \ + ghcr.io/pkgforge-dev/archlinux:latest \ + /bin/sh ./useful-tools/demo/${{ matrix.script }}.sh + + - name: Upload artifact + uses: actions/upload-artifact@b7c566a772e6b6bfb58ed0dc250532a479d7789f # v6.0.0 + with: + name: AppImage-${{ matrix.arch }}-${{ matrix.script }} + path: dist + release: - if: ${{ github.ref_name == 'main' && needs.build.result == 'success' }} - needs: [build] + if: >- + ${{ !cancelled() && github.ref_name == 'main' + && needs.build.result == 'success' + && needs.build-additional-cpu-arches.result != 'failure' }} + needs: [build, build-additional-cpu-arches] permissions: write-all runs-on: ubuntu-latest steps: diff --git a/useful-tools/demo/vkcube-glxgears-appimage.sh b/useful-tools/demo/vkcube-glxgears-appimage.sh index 8a304f57..9957c094 100644 --- a/useful-tools/demo/vkcube-glxgears-appimage.sh +++ b/useful-tools/demo/vkcube-glxgears-appimage.sh @@ -15,7 +15,11 @@ export ICON=DUMMY export DESKTOP=DUMMY export OUTPATH=./dist export OUTNAME=vkcube+glxgears-demo-"$ARCH".AppImage +# BE ppc64 predates vulkan, so glxgears is the default binary there export MAIN_BIN=vkcube +case "$ARCH" in + ppc64) export MAIN_BIN=glxgears;; +esac # vkmark is hardcoded to look in /usr/share/vkmark and /usr/lib/vkmark export PATH_MAPPING=' /usr/share/vkmark:${SHARUN_DIR}/share/vkmark