88 branches :
99 - main
1010 paths :
11- - .github/workflows/build-ci-container-code-format.yml
12- - ' .github/workflows/containers/github-action-ci-code-format/**'
13- - llvm/utils/git/code-format-helper.py
11+ - .github/workflows/build-ci-container-tooling.yml
12+ - ' .github/workflows/containers/github-action-ci-tooling/**'
1413 - llvm/utils/git/requirements_formatting.txt
15- - llvm/utils/git/requirements_formatting .txt.in
14+ - llvm/utils/git/requirements_linting .txt
1615 pull_request :
1716 paths :
18- - .github/workflows/build-ci-container-code-format.yml
19- - ' .github/workflows/containers/github-action-ci-code-format/**'
20- - llvm/utils/git/code-format-helper.py
17+ - .github/workflows/build-ci-container-tooling.yml
18+ - ' .github/workflows/containers/github-action-ci-tooling/**'
2119 - llvm/utils/git/requirements_formatting.txt
22- - llvm/utils/git/requirements_formatting .txt.in
20+ - llvm/utils/git/requirements_linting .txt
2321
2422jobs :
25- build-ci-container-code-format :
23+ build-ci-container-tooling :
2624 if : github.repository_owner == 'llvm'
2725 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
2836 steps :
2937 - name : Checkout LLVM
3038 uses : actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
3139 with :
3240 sparse-checkout : |
33- .github/workflows/containers/github-action-ci-code-format /
41+ .github/workflows/containers/github-action-ci-tooling /
3442 llvm/utils/git/requirements_formatting.txt
43+ llvm/utils/git/requirements_linting.txt
44+ clang-tools-extra/clang-tidy/tool/clang-tidy-diff.py
3545
3646 - name : Write Variables
3747 id : vars
3848 run : |
3949 tag=$(git rev-parse --short=12 HEAD)
40- container_name="ghcr.io/$GITHUB_REPOSITORY_OWNER/amd64/ci-ubuntu-24.04-code-format "
50+ container_name="ghcr.io/$GITHUB_REPOSITORY_OWNER/amd64/ci-ubuntu-24.04-${{ matrix.container_name }} "
4151 echo "container-name=$container_name" >> $GITHUB_OUTPUT
4252 echo "container-name-tag=$container_name:$tag" >> $GITHUB_OUTPUT
4353 echo "container-filename=$(echo $container_name:$tag | sed -e 's/\//-/g' -e 's/:/-/g').tar" >> $GITHUB_OUTPUT
4454 - name : Build container
4555 run : |
46- podman build --target ci-container-code-format \
47- -f .github/workflows/containers/github-action-ci-code-format /Dockerfile \
56+ podman build --target ${{ matrix.target }} \
57+ -f .github/workflows/containers/github-action-ci-tooling /Dockerfile \
4858 -t ${{ steps.vars.outputs.container-name-tag }} .
4959
5060 # Save the container so we have it in case the push fails. This also
@@ -57,21 +67,21 @@ jobs:
5767 - name : Upload container image
5868 uses : actions/upload-artifact@65c4c4a1ddee5b72f698fdd19549f0f0fb45cf08 # v4.6.0
5969 with :
60- name : container-amd64
70+ name : container-amd64-${{ matrix.container_name }}
6171 path : " *.tar"
6272 retention-days : 14
6373
6474 - name : Test Container
6575 run : |
6676 for image in ${{ steps.vars.outputs.container-name-tag }}; do
6777 # Use --pull=never to ensure we are testing the just built image.
68- podman run --pull=never --rm -it $image /usr/bin/bash -x -c 'cd $HOME && clang-format --version | grep version '
78+ podman run --pull=never --rm -it $image /usr/bin/bash -x -c 'cd $HOME && ${{ matrix.check_line }} '
6979 done
7080
7181 push-ci-container :
7282 if : github.event_name == 'push'
7383 needs :
74- - build-ci-container-code-format
84+ - build-ci-container-tooling
7585 permissions :
7686 packages : write
7787 runs-on : ubuntu-24.04
0 commit comments