Skip to content

Commit 6e59a7a

Browse files
committed
Run AMD and ARM builds on separate runners
1 parent b7d59ae commit 6e59a7a

File tree

3 files changed

+82
-180
lines changed

3 files changed

+82
-180
lines changed

.github/workflows/debian.yml

Lines changed: 32 additions & 60 deletions
Original file line numberDiff line numberDiff line change
@@ -14,71 +14,39 @@ env:
1414
NONROOT_USER: ci
1515

1616
jobs:
17-
# Build the Docker image for Debian using different versions of GCC.
18-
gcc:
19-
runs-on: ubuntu-latest
17+
# Build the Docker image for Debian using different versions of GCC and Clang.
18+
build:
2019
strategy:
2120
matrix:
22-
version:
21+
platform:
2322
- os: bookworm
24-
gcc: 12
23+
compiler: gcc
24+
version: 12
2525
- os: bookworm
26-
gcc: 13
26+
compiler: gcc
27+
version: 13
2728
- os: bookworm
28-
gcc: 14
29-
steps:
30-
- name: Checkout repository
31-
uses: actions/checkout@v4
32-
- name: Set up QEMU
33-
uses: docker/setup-qemu-action@v3
34-
- name: Set up Docker Buildx
35-
uses: docker/setup-buildx-action@v3
36-
- name: Login to GitHub Registry
37-
uses: docker/login-action@v3
38-
with:
39-
registry: ${{ env.CONTAINER_REGISTRY }}
40-
username: ${{ github.repository_owner }}
41-
password: ${{ secrets.GITHUB_TOKEN }}
42-
- name: Determine the Docker image name.
43-
run: |
44-
# Convert the repository name to lowercase as the organization name is
45-
# uppercase, which is not permitted by the Docker registry.
46-
GITHUB_REPO=${{ github.repository }}
47-
CONTAINER_REPOSITORY=${GITHUB_REPO@L}
48-
echo "CONTAINER_IMAGE=${CONTAINER_REGISTRY}/${CONTAINER_REPOSITORY}/debian-${{ matrix.version.os }}:gcc${{ matrix.version.gcc }}" >> $GITHUB_ENV
49-
- name: Build and push the Docker image
50-
uses: docker/build-push-action@v6
51-
with:
52-
build-args: |
53-
BUILDKIT_DOCKERFILE_CHECK=skip=InvalidDefaultArgInFrom
54-
BUILDKIT_INLINE_CACHE=1
55-
CONAN_VERSION=${{ env.CONAN_VERSION }}
56-
DEBIAN_VERSION=${{ matrix.version.os }}
57-
GCC_VERSION=${{ matrix.version.gcc }}
58-
GITHUB_REPO=${{ github.repository }}
59-
NONROOT_USER=${{ env.NONROOT_USER }}
60-
context: docker/debian
61-
platforms: linux/amd64,linux/arm64
62-
push: true
63-
tags: ${{ env.CONTAINER_IMAGE }}
64-
target: gcc
65-
66-
# Build the Docker image for Debian using different versions of Clang.
67-
clang:
68-
runs-on: ubuntu-latest
69-
strategy:
70-
matrix:
71-
version:
29+
compiler: gcc
30+
version: 14
7231
- os: bookworm
73-
clang: 16
32+
compiler: clang
33+
version: 16
7434
- os: bookworm
75-
clang: 17
35+
compiler: clang
36+
version: 17
7637
- os: bookworm
77-
clang: 18
38+
compiler: clang
39+
version: 18
7840
- os: bookworm
79-
clang: 19
41+
compiler: clang
42+
version: 19
8043
- os: bookworm
81-
clang: 20
44+
compiler: clang
45+
version: 20
46+
architecture:
47+
- linux/amd64
48+
- linux/arm64
49+
runs-on: ubuntu-24.04${{ matrix.architecture == 'linux/arm64' && '-arm' || '' }}
8250
steps:
8351
- name: Checkout repository
8452
uses: actions/checkout@v4
@@ -98,20 +66,24 @@ jobs:
9866
# uppercase, which is not permitted by the Docker registry.
9967
GITHUB_REPO=${{ github.repository }}
10068
CONTAINER_REPOSITORY=${GITHUB_REPO@L}
101-
echo "CONTAINER_IMAGE=${CONTAINER_REGISTRY}/${CONTAINER_REPOSITORY}/debian-${{ matrix.version.os }}:clang${{ matrix.version.clang }}" >> $GITHUB_ENV
69+
echo "CONTAINER_IMAGE=${CONTAINER_REGISTRY}/${CONTAINER_REPOSITORY}/debian-${{ matrix.platform.os }}:${{ matrix.platform.compiler }}${{ matrix.platform.version }}" >> $GITHUB_ENV
10270
- name: Build and push the Docker image
10371
uses: docker/build-push-action@v6
10472
with:
10573
build-args: |
10674
BUILDKIT_DOCKERFILE_CHECK=skip=InvalidDefaultArgInFrom
10775
BUILDKIT_INLINE_CACHE=1
108-
CLANG_VERSION=${{ matrix.version.clang }}
76+
CLANG_VERSION=${{ matrix.platform.compiler == 'clang' && matrix.platform.version || '' }}
10977
CONAN_VERSION=${{ env.CONAN_VERSION }}
110-
DEBIAN_VERSION=${{ matrix.version.os }}
78+
DEBIAN_VERSION=${{ matrix.platform.os }}
79+
GCC_VERSION=${{ matrix.platform.compiler == 'gcc' && matrix.platform.version || '' }}
11180
GITHUB_REPO=${{ github.repository }}
11281
NONROOT_USER=${{ env.NONROOT_USER }}
11382
context: docker/debian
114-
platforms: linux/amd64,linux/arm64
83+
outputs: type=image,name=${{ env.CONTAINER_IMAGE }},push-by-digest=true,name-canonical=true,push=true
84+
platforms: ${{ matrix.architecture }}
85+
provenance: mode=max
11586
push: true
87+
sbom: true
11688
tags: ${{ env.CONTAINER_IMAGE }}
117-
target: clang
89+
target: ${{ matrix.platform.compiler }}

.github/workflows/rhel.yml

Lines changed: 20 additions & 60 deletions
Original file line numberDiff line numberDiff line change
@@ -16,68 +16,24 @@ env:
1616

1717
jobs:
1818
# Build the Docker image for Red Hat Enterprise Linux using different versions
19-
# of GCC.
19+
# of GCC and Clang.
2020
gcc:
21-
runs-on: ubuntu-latest
2221
strategy:
2322
matrix:
24-
version:
23+
platform:
2524
- os: 9.6
26-
gcc: 13
25+
compiler: gcc
26+
version: 13
2727
- os: 9.6
28-
gcc: 14
29-
steps:
30-
- name: Checkout repository
31-
uses: actions/checkout@v4
32-
- name: Set up QEMU
33-
uses: docker/setup-qemu-action@v3
34-
- name: Set up Docker Buildx
35-
uses: docker/setup-buildx-action@v3
36-
- name: Login to GitHub Registry
37-
uses: docker/login-action@v3
38-
with:
39-
registry: ${{ env.CONTAINER_REGISTRY }}
40-
username: ${{ github.repository_owner }}
41-
password: ${{ secrets.GITHUB_TOKEN }}
42-
- name: Login to Red Hat Registry
43-
uses: docker/login-action@v3
44-
with:
45-
registry: ${{ env.REDHAT_REGISTRY }}
46-
username: ${{ secrets.REDHAT_USER }}
47-
password: ${{ secrets.REDHAT_TOKEN }}
48-
- name: Determine the Docker image name.
49-
run: |
50-
# Convert the repository name to lowercase as the organization name is
51-
# uppercase, which is not permitted by the Docker registry.
52-
GITHUB_REPO=${{ github.repository }}
53-
CONTAINER_REPOSITORY=${GITHUB_REPO@L}
54-
echo "CONTAINER_IMAGE=${CONTAINER_REGISTRY}/${CONTAINER_REPOSITORY}/rhel-${{ matrix.version.os }}:gcc${{ matrix.version.gcc }}" >> $GITHUB_ENV
55-
- name: Build and push the Docker image
56-
uses: docker/build-push-action@v6
57-
with:
58-
build-args: |
59-
BUILDKIT_DOCKERFILE_CHECK=skip=InvalidDefaultArgInFrom
60-
BUILDKIT_INLINE_CACHE=1
61-
CONAN_VERSION=${{ env.CONAN_VERSION }}
62-
GCC_VERSION=${{ matrix.version.gcc }}
63-
GITHUB_REPO=${{ github.repository }}
64-
NONROOT_USER=${{ env.NONROOT_USER }}
65-
RHEL_VERSION=${{ matrix.version.os }}
66-
context: docker/rhel
67-
platforms: linux/amd64,linux/arm64
68-
push: true
69-
tags: ${{ env.CONTAINER_IMAGE }}
70-
target: gcc
71-
72-
# Build the Docker image for Red Hat Enterprise Linux using Clang. As we use
73-
# the free UBIs we cannot select specific versions of Clang and only get what
74-
# is available in the base image.
75-
clang:
76-
runs-on: ubuntu-latest
77-
strategy:
78-
matrix:
79-
version:
28+
compiler: gcc
29+
version: 14
8030
- os: 9.6
31+
compiler: clang
32+
version: ''
33+
architecture:
34+
- linux/amd64
35+
- linux/arm64
36+
runs-on: ubuntu-24.04${{ matrix.architecture == 'linux/arm64' && '-arm' || '' }}
8137
steps:
8238
- name: Checkout repository
8339
uses: actions/checkout@v4
@@ -96,26 +52,30 @@ jobs:
9652
with:
9753
registry: ${{ env.REDHAT_REGISTRY }}
9854
username: ${{ secrets.REDHAT_USER }}
99-
password: ${{ secrets.REDHAT_TOKEN }}
55+
password: ${{ secrets.REDHAT_TOKEN }}
10056
- name: Determine the Docker image name.
10157
run: |
10258
# Convert the repository name to lowercase as the organization name is
10359
# uppercase, which is not permitted by the Docker registry.
10460
GITHUB_REPO=${{ github.repository }}
10561
CONTAINER_REPOSITORY=${GITHUB_REPO@L}
106-
echo "CONTAINER_IMAGE=${CONTAINER_REGISTRY}/${CONTAINER_REPOSITORY}/rhel-${{ matrix.version.os }}:clang" >> $GITHUB_ENV
62+
echo "CONTAINER_IMAGE=${CONTAINER_REGISTRY}/${CONTAINER_REPOSITORY}/rhel-${{ matrix.platform.os }}:${{ matrix.platform.compiler }}${{ matrix.platform.version }}" >> $GITHUB_ENV
10763
- name: Build and push the Docker image
10864
uses: docker/build-push-action@v6
10965
with:
11066
build-args: |
11167
BUILDKIT_DOCKERFILE_CHECK=skip=InvalidDefaultArgInFrom
11268
BUILDKIT_INLINE_CACHE=1
11369
CONAN_VERSION=${{ env.CONAN_VERSION }}
70+
GCC_VERSION=${{ matrix.platform.compiler == 'gcc' && matrix.platform.version || '' }}
11471
GITHUB_REPO=${{ github.repository }}
11572
NONROOT_USER=${{ env.NONROOT_USER }}
11673
RHEL_VERSION=${{ matrix.version.os }}
11774
context: docker/rhel
118-
platforms: linux/amd64,linux/arm64
75+
outputs: type=image,name=${{ env.CONTAINER_IMAGE }},push-by-digest=true,name-canonical=true,push=true
76+
platforms: ${{ matrix.architecture }}
77+
provenance: mode=max
11978
push: true
79+
sbom: true
12080
tags: ${{ env.CONTAINER_IMAGE }}
121-
target: clang
81+
target: ${{ matrix.platform.compiler }}

.github/workflows/ubuntu.yml

Lines changed: 30 additions & 60 deletions
Original file line numberDiff line numberDiff line change
@@ -14,71 +14,37 @@ env:
1414
NONROOT_USER: ci
1515

1616
jobs:
17-
# Build the Docker image for Ubuntu using different versions of GCC. See
18-
# https://documentation.ubuntu.com/ubuntu-for-developers/reference/availability/gcc/.
17+
# Build the Docker image for Ubuntu using different versions of GCC and Clang.
18+
# See https://documentation.ubuntu.com/ubuntu-for-developers/reference/availability/gcc/.
1919
gcc:
20-
runs-on: ubuntu-latest
2120
strategy:
2221
matrix:
23-
version:
22+
platform:
2423
- os: jammy
25-
gcc: 12
24+
compiler: gcc
25+
version: 12
2626
- os: noble
27-
gcc: 13
27+
compiler: gcc
28+
version: 13
2829
- os: noble
29-
gcc: 14
30-
steps:
31-
- name: Checkout repository
32-
uses: actions/checkout@v4
33-
- name: Set up QEMU
34-
uses: docker/setup-qemu-action@v3
35-
- name: Set up Docker Buildx
36-
uses: docker/setup-buildx-action@v3
37-
- name: Login to GitHub Registry
38-
uses: docker/login-action@v3
39-
with:
40-
registry: ${{ env.CONTAINER_REGISTRY }}
41-
username: ${{ github.repository_owner }}
42-
password: ${{ secrets.GITHUB_TOKEN }}
43-
- name: Determine the Docker image name.
44-
run: |
45-
# Convert the repository name to lowercase as the organization name is
46-
# uppercase, which is not permitted by the Docker registry.
47-
GITHUB_REPO=${{ github.repository }}
48-
CONTAINER_REPOSITORY=${GITHUB_REPO@L}
49-
echo "CONTAINER_IMAGE=${CONTAINER_REGISTRY}/${CONTAINER_REPOSITORY}/ubuntu-${{ matrix.version.os }}:gcc${{ matrix.version.gcc }}" >> $GITHUB_ENV
50-
- name: Build and push the Docker image
51-
uses: docker/build-push-action@v6
52-
with:
53-
build-args: |
54-
BUILDKIT_DOCKERFILE_CHECK=skip=InvalidDefaultArgInFrom
55-
BUILDKIT_INLINE_CACHE=1
56-
CONAN_VERSION=${{ env.CONAN_VERSION }}
57-
GCC_VERSION=${{ matrix.version.gcc }}
58-
GITHUB_REPO=${{ github.repository }}
59-
NONROOT_USER=${{ env.NONROOT_USER }}
60-
UBUNTU_VERSION=${{ matrix.version.os }}
61-
context: docker/ubuntu
62-
platforms: linux/amd64,linux/arm64
63-
push: true
64-
tags: ${{ env.CONTAINER_IMAGE }}
65-
target: gcc
66-
67-
# Build the Docker image for Ubuntu using different versions of Clang. See
68-
# https://documentation.ubuntu.com/ubuntu-for-developers/reference/availability/llvm/.
69-
clang:
70-
runs-on: ubuntu-latest
71-
strategy:
72-
matrix:
73-
version:
30+
compiler: gcc
31+
version: 14
7432
- os: noble
75-
clang: 16
33+
compiler: clang
34+
version: 16
7635
- os: noble
77-
clang: 17
36+
compiler: clang
37+
version: 17
7838
- os: noble
79-
clang: 18
39+
compiler: clang
40+
version: 18
8041
- os: noble
81-
clang: 19
42+
compiler: clang
43+
version: 19
44+
architecture:
45+
- linux/amd64
46+
- linux/arm64
47+
runs-on: ubuntu-24.04${{ matrix.architecture == 'linux/arm64' && '-arm' || '' }}
8248
steps:
8349
- name: Checkout repository
8450
uses: actions/checkout@v4
@@ -98,20 +64,24 @@ jobs:
9864
# uppercase, which is not permitted by the Docker registry.
9965
GITHUB_REPO=${{ github.repository }}
10066
CONTAINER_REPOSITORY=${GITHUB_REPO@L}
101-
echo "CONTAINER_IMAGE=${CONTAINER_REGISTRY}/${CONTAINER_REPOSITORY}/ubuntu-${{ matrix.version.os }}:clang${{ matrix.version.clang }}" >> $GITHUB_ENV
67+
echo "CONTAINER_IMAGE=${CONTAINER_REGISTRY}/${CONTAINER_REPOSITORY}/ubuntu-${{ matrix.platform.os }}:${{ matrix.platform.compiler }}${{ matrix.platform.version }}" >> $GITHUB_ENV
10268
- name: Build and push the Docker image
10369
uses: docker/build-push-action@v6
10470
with:
10571
build-args: |
10672
BUILDKIT_DOCKERFILE_CHECK=skip=InvalidDefaultArgInFrom
10773
BUILDKIT_INLINE_CACHE=1
108-
CLANG_VERSION=${{ matrix.version.clang }}
74+
CLANG_VERSION=${{ matrix.platform.compiler == 'clang' && matrix.platform.version || '' }}
10975
CONAN_VERSION=${{ env.CONAN_VERSION }}
76+
GCC_VERSION=${{ matrix.platform.compiler == 'gcc' && matrix.platform.version || '' }}
11077
GITHUB_REPO=${{ github.repository }}
11178
NONROOT_USER=${{ env.NONROOT_USER }}
112-
UBUNTU_VERSION=${{ matrix.version.os }}
79+
UBUNTU_VERSION=${{ matrix.platform.os }}
11380
context: docker/ubuntu
114-
platforms: linux/amd64,linux/arm64
81+
outputs: type=image,name=${{ env.CONTAINER_IMAGE }},push-by-digest=true,name-canonical=true,push=true
82+
platforms: ${{ matrix.architecture }}
83+
provenance: mode=max
11584
push: true
85+
sbom: true
11686
tags: ${{ env.CONTAINER_IMAGE }}
117-
target: clang
87+
target: ${{ matrix.platform.compiler }}

0 commit comments

Comments
 (0)