Skip to content
Latchkey

Build Multiarch workflow (CalebBell/ht)

The Build Multiarch workflow from CalebBell/ht, explained and optimized by Latchkey.

B

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.

Grade your own workflow free or run it on Latchkey →
Source: CalebBell/ht.github/workflows/build-multiarch.ymlLicense MITView source

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

workflow (.yml)
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

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.

Actions used in this workflow