2222jobs :
2323 build-ci-container-tooling :
2424 if : github.repository_owner == 'llvm'
25- runs-on : depot-ubuntu-24.04-16
26- strategy :
27- matrix :
28- target : [ci-container-code-format, ci-container-code-lint]
29- include :
30- - target : ci-container-code-format
31- container_name : code-format
32- check_line : clang-format --version | grep version
33- - target : ci-container-code-lint
34- container_name : code-lint
35- check_line : clang-tidy --version | grep version
25+ runs-on : ubuntu-24.04
3626 steps :
3727 - name : Checkout LLVM
3828 uses : actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
@@ -47,36 +37,42 @@ jobs:
4737 id : vars
4838 run : |
4939 tag=$(git rev-parse --short=12 HEAD)
50- container_name="ghcr.io/$GITHUB_REPOSITORY_OWNER/amd64/ci-ubuntu-24.04-${{ matrix.container_name }}"
51- echo "container-name=$container_name" >> $GITHUB_OUTPUT
52- echo "container-name-tag=$container_name:$tag" >> $GITHUB_OUTPUT
53- echo "container-filename=$(echo $container_name:$tag | sed -e 's/\//-/g' -e 's/:/-/g').tar" >> $GITHUB_OUTPUT
40+ container_name="ghcr.io/$GITHUB_REPOSITORY_OWNER/amd64/ci-ubuntu-24.04"
41+ echo "container-name-format=$container_name-code-format" >> $GITHUB_OUTPUT
42+ echo "container-name-lint=$container_name-code-lint" >> $GITHUB_OUTPUT
43+ echo "container-name-format-tag=$container_name-format:$tag" >> $GITHUB_OUTPUT
44+ echo "container-name-lint-tag=$container_name-lint:$tag" >> $GITHUB_OUTPUT
45+ echo "container-format-filename=$(echo $container_name-format:$tag | sed -e 's/\//-/g' -e 's/:/-/g').tar" >> $GITHUB_OUTPUT
46+ echo "container-lint-filename=$(echo $container_name-lint:$tag | sed -e 's/\//-/g' -e 's/:/-/g').tar" >> $GITHUB_OUTPUT
5447 - name : Build container
5548 run : |
56- podman build --target ${{ matrix.target }} \
49+ podman build --target ci-container-code-format \
50+ -f .github/workflows/containers/github-action-ci-tooling/Dockerfile \
51+ -t ${{ steps.vars.outputs.container-name-format-tag }} .
52+ podman build --target ci-container-code-lint \
5753 -f .github/workflows/containers/github-action-ci-tooling/Dockerfile \
58- -t ${{ steps.vars.outputs.container-name-tag }} .
54+ -t ${{ steps.vars.outputs.container-name-lint- tag }} .
5955
6056 # Save the container so we have it in case the push fails. This also
6157 # allows us to separate the push step into a different job so we can
6258 # maintain minimal permissions while building the container.
6359 - name : Save container image
6460 run : |
65- podman save ${{ steps.vars.outputs.container-name-tag }} > ${{ steps.vars.outputs.container-filename }}
61+ podman save ${{ steps.vars.outputs.container-name-format-tag }} > ${{ steps.vars.outputs.container-format-filename }}
62+ podman save ${{ steps.vars.outputs.container-name-lint-tag }} > ${{ steps.vars.outputs.container-lint-filename }}
6663
6764 - name : Upload container image
6865 uses : actions/upload-artifact@65c4c4a1ddee5b72f698fdd19549f0f0fb45cf08 # v4.6.0
6966 with :
70- name : container-amd64-${{ matrix.container_name }}
67+ name : container-amd64
7168 path : " *.tar"
7269 retention-days : 14
7370
7471 - name : Test Container
7572 run : |
76- for image in ${{ steps.vars.outputs.container-name-tag }}; do
77- # Use --pull=never to ensure we are testing the just built image.
78- podman run --pull=never --rm -it $image /usr/bin/bash -x -c 'cd $HOME && ${{ matrix.check_line }}'
79- done
73+ # Use --pull=never to ensure we are testing the just built image.
74+ podman run --pull=never --rm -it ${{ steps.vars.outputs.container-name-format-tag }} /usr/bin/bash -x -c 'cd $HOME && clang-format --version | grep version && black --version | grep black'
75+ podman run --pull=never --rm -it ${{ steps.vars.outputs.container-name-lint-tag }} /usr/bin/bash -x -c 'cd $HOME && clang-tidy --version | grep version && clang-tidy-diff.py -h | grep usage'
8076
8177 push-ci-container :
8278 if : github.event_name == 'push'
0 commit comments