1616
1717jobs :
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 }}
0 commit comments