Build Multiarch workflow (CalebBell/ht)
The Build Multiarch workflow from CalebBell/ht, explained and optimized by Latchkey.
CI health: B - good
Point runs-on at Latchkey and get job timeouts, SHA-pinned actions, self-healing for flaky steps, and up to 58% lower cost, applied automatically.
What it does
This is the Build Multiarch workflow from the CalebBell/ht repository, a real project running GitHub Actions. It is shown here with attribution under its MIT license.
Below, Latchkey shows a faster, safer version produced by its optimization engine.
The workflow
name: Build Multiarch
on:
push:
branches: [release]
pull_request:
branches: [master, release]
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: ${{ github.ref != 'refs/heads/master' && github.ref != 'refs/heads/release' }}
jobs:
multi-arch-test:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
include:
# Disabled: Docker localhost registry connection refused error on armv6/trixie
# - arch: armv6
# distro: trixie
- arch: armv7
distro: trixie
- arch: aarch64
distro: trixie
- arch: riscv64
distro: trixie
- arch: s390x
distro: trixie
- arch: ppc64le
distro: trixie
- arch: armv7
distro: ubuntu_latest
- arch: aarch64
distro: ubuntu_latest
- arch: s390x
distro: ubuntu_latest
- arch: ppc64le
distro: ubuntu_latest
- arch: armv6
distro: alpine_latest
- arch: armv7
distro: alpine_latest
- arch: aarch64
distro: alpine_latest
- arch: riscv64
distro: alpine_latest
- arch: s390x
distro: alpine_latest
- arch: ppc64le
distro: alpine_latest
steps:
- uses: actions/checkout@v4
- name: Install Just
uses: extractions/setup-just@v2
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
with:
image: tonistiigi/binfmt:qemu-v8.1.5
- name: Run tests on ${{ matrix.arch }}/${{ matrix.distro }}
run: just test-arch ${{ matrix.arch }} ${{ matrix.distro }}
The same workflow, on Latchkey
Removes redundant runs and caps runaway jobs. Added and changed lines are highlighted.
name: Build Multiarch on: push: branches: [release] pull_request: branches: [master, release] concurrency: group: ${{ github.workflow }}-${{ github.ref }} cancel-in-progress: ${{ github.ref != 'refs/heads/master' && github.ref != 'refs/heads/release' }} jobs: multi-arch-test: timeout-minutes: 30 runs-on: latchkey-small strategy: fail-fast: false matrix: include: # Disabled: Docker localhost registry connection refused error on armv6/trixie # - arch: armv6 # distro: trixie - arch: armv7 distro: trixie - arch: aarch64 distro: trixie - arch: riscv64 distro: trixie - arch: s390x distro: trixie - arch: ppc64le distro: trixie - arch: armv7 distro: ubuntu_latest - arch: aarch64 distro: ubuntu_latest - arch: s390x distro: ubuntu_latest - arch: ppc64le distro: ubuntu_latest - arch: armv6 distro: alpine_latest - arch: armv7 distro: alpine_latest - arch: aarch64 distro: alpine_latest - arch: riscv64 distro: alpine_latest - arch: s390x distro: alpine_latest - arch: ppc64le distro: alpine_latest steps: - uses: actions/checkout@v4 - name: Install Just uses: extractions/setup-just@v2 - name: Set up QEMU uses: docker/setup-qemu-action@v3 with: image: tonistiigi/binfmt:qemu-v8.1.5 - name: Run tests on ${{ matrix.arch }}/${{ matrix.distro }} run: just test-arch ${{ matrix.arch }} ${{ matrix.distro }}
What changed
- Run on Latchkey managed runners with one line (
runs-on), which apply the fixes below automatically and self-heal transient failures. This example useslatchkey-small; pick the runner size that fits the job. - Add a job timeout so a hung step cannot burn hours of runner time.
2 third-party actions are referenced by a movable tag. Pin them to the commit SHA (Latchkey resolves and applies this automatically) so a repointed tag cannot change what runs.
This workflow runs 1 job per trigger. On Latchkey the same minutes cost up to 58% less than GitHub-hosted, with zero queue time.