Skip to content

Run AMD and ARM builds on separate runners #50

Run AMD and ARM builds on separate runners

Run AMD and ARM builds on separate runners #50

Workflow file for this run

name: Ubuntu
on:
push:
paths:
- .github/workflows/ubuntu.yml
- docker/ubuntu/Dockerfile
env:
CONTAINER_REGISTRY: ghcr.io
DOCKER_BUILDKIT: 1
BUILDKIT_PROGRESS: plain
CONAN_VERSION: 2.17.0
NONROOT_USER: ci
jobs:
# Build the Docker image for Ubuntu using different versions of GCC and Clang.
# See https://documentation.ubuntu.com/ubuntu-for-developers/reference/availability/gcc/.
gcc:
strategy:
matrix:
platform:
- os: jammy
compiler: gcc
version: 12
- os: noble
compiler: gcc
version: 13
- os: noble
compiler: gcc
version: 14
- os: noble
compiler: clang
version: 16
- os: noble
compiler: clang
version: 17
- os: noble
compiler: clang
version: 18
- os: noble
compiler: clang
version: 19
architecture:
- linux/amd64
- linux/arm64
runs-on: ubuntu-24.04${{ matrix.architecture == 'linux/arm64' && '-arm' || '' }}
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Login to GitHub Registry
uses: docker/login-action@v3
with:
registry: ${{ env.CONTAINER_REGISTRY }}
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Determine the Docker image name.
run: |
# Convert the repository name to lowercase as the organization name is
# uppercase, which is not permitted by the Docker registry.
GITHUB_REPO=${{ github.repository }}
CONTAINER_REPOSITORY=${GITHUB_REPO@L}
echo "CONTAINER_IMAGE=${CONTAINER_REGISTRY}/${CONTAINER_REPOSITORY}/ubuntu-${{ matrix.platform.os }}:${{ matrix.platform.compiler }}${{ matrix.platform.version }}" >> $GITHUB_ENV
- name: Build and push the Docker image
uses: docker/build-push-action@v6
with:
build-args: |
BUILDKIT_DOCKERFILE_CHECK=skip=InvalidDefaultArgInFrom
BUILDKIT_INLINE_CACHE=1
CLANG_VERSION=${{ matrix.platform.compiler == 'clang' && matrix.platform.version || '' }}
CONAN_VERSION=${{ env.CONAN_VERSION }}
GCC_VERSION=${{ matrix.platform.compiler == 'gcc' && matrix.platform.version || '' }}
GITHUB_REPO=${{ github.repository }}
NONROOT_USER=${{ env.NONROOT_USER }}
UBUNTU_VERSION=${{ matrix.platform.os }}
context: docker/ubuntu
outputs: type=image,name=${{ env.CONTAINER_IMAGE }},push-by-digest=true,name-canonical=true,push=true
platforms: ${{ matrix.architecture }}
provenance: mode=max
push: true
sbom: true
tags: ${{ env.CONTAINER_IMAGE }}
target: ${{ matrix.platform.compiler }}