[llvm] [GitHub][CI] Add a new container to use for the abi tests (PR #166886)
Tom Stellard via llvm-commits
llvm-commits at lists.llvm.org
Fri Nov 7 09:01:19 PST 2025
https://github.com/tstellar updated https://github.com/llvm/llvm-project/pull/166886
>From 54548a7923c3500bc8932792328a69667e17f098 Mon Sep 17 00:00:00 2001
From: Tom Stellard <tstellar at redhat.com>
Date: Tue, 4 Nov 2025 22:43:01 +0000
Subject: [PATCH 1/4] [GitHub][CI] Split out build tool setup from code-lint
containre
This way it can be shared with another container.
---
.../github-action-ci-tooling/Dockerfile | 36 +++++++++++--------
1 file changed, 21 insertions(+), 15 deletions(-)
diff --git a/.github/workflows/containers/github-action-ci-tooling/Dockerfile b/.github/workflows/containers/github-action-ci-tooling/Dockerfile
index 707bdb309b789..c01811e49fa95 100644
--- a/.github/workflows/containers/github-action-ci-tooling/Dockerfile
+++ b/.github/workflows/containers/github-action-ci-tooling/Dockerfile
@@ -47,6 +47,26 @@ RUN echo '%sudo ALL=(ALL) NOPASSWD:ALL' >> /etc/sudoers
# as root in 'ci-container-code-format' and 'ci-container-code-lint' containers
+FROM base AS ci-container-build-tools
+
+COPY --from=llvm-downloader /llvm-extract/LLVM-${LLVM_VERSION}-Linux-X64/bin/clang-${LLVM_VERSION_MAJOR} \
+ ${LLVM_SYSROOT}/bin/
+COPY --from=llvm-downloader /llvm-extract/LLVM-${LLVM_VERSION}-Linux-X64/lib/clang/${LLVM_VERSION_MAJOR}/include \
+ ${LLVM_SYSROOT}/lib/clang/${LLVM_VERSION_MAJOR}/include
+RUN ln -s ${LLVM_SYSROOT}/bin/clang-${LLVM_VERSION_MAJOR} ${LLVM_SYSROOT}/bin/clang && \
+ ln -s ${LLVM_SYSROOT}/bin/clang ${LLVM_SYSROOT}/bin/clang++
+
+RUN apt-get update && \
+ DEBIAN_FRONTEND=noninteractive apt-get install -y \
+ cmake \
+ ninja-build && \
+ apt-get clean && \
+ rm -rf /var/lib/apt/lists/*
+
+ENV CC=${LLVM_SYSROOT}/bin/clang
+ENV CXX=${LLVM_SYSROOT}/bin/clang++
+
+
FROM base AS ci-container-code-format
ARG LLVM_VERSION
@@ -63,28 +83,14 @@ USER gha
WORKDIR /home/gha
-FROM base AS ci-container-code-lint
+FROM base AS ci-container-build-tools
ARG LLVM_VERSION
ARG LLVM_VERSION_MAJOR
COPY --from=llvm-downloader /llvm-extract/LLVM-${LLVM_VERSION}-Linux-X64/bin/clang-tidy \
- /llvm-extract/LLVM-${LLVM_VERSION}-Linux-X64/bin/clang-${LLVM_VERSION_MAJOR} \
${LLVM_SYSROOT}/bin/
-COPY --from=llvm-downloader /llvm-extract/LLVM-${LLVM_VERSION}-Linux-X64/lib/clang/${LLVM_VERSION_MAJOR}/include \
- ${LLVM_SYSROOT}/lib/clang/${LLVM_VERSION_MAJOR}/include
COPY clang-tools-extra/clang-tidy/tool/clang-tidy-diff.py ${LLVM_SYSROOT}/bin/clang-tidy-diff.py
-RUN ln -s ${LLVM_SYSROOT}/bin/clang-${LLVM_VERSION_MAJOR} ${LLVM_SYSROOT}/bin/clang && \
- ln -s ${LLVM_SYSROOT}/bin/clang ${LLVM_SYSROOT}/bin/clang++
-
-
-RUN apt-get update && \
- DEBIAN_FRONTEND=noninteractive apt-get install -y \
- cmake \
- ninja-build && \
- apt-get clean && \
- rm -rf /var/lib/apt/lists/*
-
# Install dependencies for 'pr-code-lint.yml' job
COPY llvm/utils/git/requirements_linting.txt requirements_linting.txt
RUN pip install -r requirements_linting.txt --break-system-packages && \
>From 5001ad5c61fa9bbfe1e75a7ff6040fc713e7a026 Mon Sep 17 00:00:00 2001
From: Tom Stellard <tstellar at redhat.com>
Date: Tue, 4 Nov 2025 23:14:01 +0000
Subject: [PATCH 2/4] [GitHub][CI] Add container for the abi-tests
---
.../github-action-ci-tooling/Dockerfile | 25 ++++++++++++++++++-
.github/workflows/llvm-abi-tests.yml | 21 +++-------------
2 files changed, 28 insertions(+), 18 deletions(-)
diff --git a/.github/workflows/containers/github-action-ci-tooling/Dockerfile b/.github/workflows/containers/github-action-ci-tooling/Dockerfile
index c01811e49fa95..7e02d2309e832 100644
--- a/.github/workflows/containers/github-action-ci-tooling/Dockerfile
+++ b/.github/workflows/containers/github-action-ci-tooling/Dockerfile
@@ -48,6 +48,8 @@ RUN echo '%sudo ALL=(ALL) NOPASSWD:ALL' >> /etc/sudoers
FROM base AS ci-container-build-tools
+ARG LLVM_VERSION
+ARG LLVM_VERSION_MAJOR
COPY --from=llvm-downloader /llvm-extract/LLVM-${LLVM_VERSION}-Linux-X64/bin/clang-${LLVM_VERSION_MAJOR} \
${LLVM_SYSROOT}/bin/
@@ -83,7 +85,7 @@ USER gha
WORKDIR /home/gha
-FROM base AS ci-container-build-tools
+FROM ci-container-build-tools AS ci-container-code-lint
ARG LLVM_VERSION
ARG LLVM_VERSION_MAJOR
@@ -97,3 +99,24 @@ RUN pip install -r requirements_linting.txt --break-system-packages && \
rm requirements_linting.txt
USER gha
WORKDIR /home/gha
+
+
+FROM ci-container-build-tools as ci-container-abi-tests
+
+RUN apt-get update && \
+ DEBIAN_FRONTEND=noninteractive apt-get install -y \
+ abi-compliance-checker \
+ abi-dumper \
+ autoconf \
+ pkg-config && \
+ apt-get clean && \
+ rm -rf /var/lib/apt/lists/*
+
+RUN git clone https://github.com/universal-ctags/ctags.git && \
+ cd ctags && \
+ ./autogen.sh && \
+ ./configure && \
+ sudo make install && \
+ rm -Rf ../ctags
+
+
diff --git a/.github/workflows/llvm-abi-tests.yml b/.github/workflows/llvm-abi-tests.yml
index b0c2d32d4a41b..2418949d2ebb8 100644
--- a/.github/workflows/llvm-abi-tests.yml
+++ b/.github/workflows/llvm-abi-tests.yml
@@ -72,6 +72,8 @@ jobs:
if: github.repository_owner == 'llvm'
needs: abi-dump-setup
runs-on: ubuntu-24.04
+ container:
+ image: ${{ format('ghcr.io/{0}/ci-container-abi-tests',github.repository_owner) }}
strategy:
matrix:
name:
@@ -87,19 +89,6 @@ jobs:
ref: ${{ github.sha }}
repo: ${{ github.repository }}
steps:
- - name: Install Ninja
- uses: llvm/actions/install-ninja at 42d80571b13f4599bbefbc7189728b64723c7f78 # main
- - name: Install abi-compliance-checker
- run: |
- sudo apt-get update
- sudo apt-get -y install abi-dumper autoconf pkg-config
- - name: Install universal-ctags
- run: |
- git clone https://github.com/universal-ctags/ctags.git
- cd ctags
- ./autogen.sh
- ./configure
- sudo make install
- name: Download source code
uses: actions/checkout at 08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
with:
@@ -143,6 +132,8 @@ jobs:
abi-compare:
if: github.repository_owner == 'llvm'
runs-on: ubuntu-24.04
+ container:
+ image: ${{ format('ghcr.io/{0}/ci-container-abi-tests',github.repository_owner) }}
needs:
- abi-dump-setup
- abi-dump
@@ -163,10 +154,6 @@ jobs:
name: symbol-list
path: symbol-list
- - name: Install abi-compliance-checker
- run: |
- sudo apt-get update
- sudo apt-get -y install abi-compliance-checker
- name: Compare ABI
run: |
if [ -s symbol-list/llvm.symbols ]; then
>From 9809e74ec0f44ea7a25cf11a69a0155b50fd4090 Mon Sep 17 00:00:00 2001
From: Tom Stellard <tstellar at redhat.com>
Date: Fri, 7 Nov 2025 03:20:17 +0000
Subject: [PATCH 3/4] Build the container
---
.github/workflows/build-ci-container-tooling.yml | 3 +++
1 file changed, 3 insertions(+)
diff --git a/.github/workflows/build-ci-container-tooling.yml b/.github/workflows/build-ci-container-tooling.yml
index 46dc38fe600a3..a29b859a4c171 100644
--- a/.github/workflows/build-ci-container-tooling.yml
+++ b/.github/workflows/build-ci-container-tooling.yml
@@ -36,6 +36,9 @@ jobs:
test-command: 'cd $HOME && clang-format --version | grep version && git-clang-format -h | grep usage && black --version | grep black'
- container-name: code-lint
test-command: 'cd $HOME && clang-tidy --version | grep version && clang-tidy-diff.py -h | grep usage'
+
+ - container-name: abi-tests
+ test-command: 'cd $HOME && abi-compliance-checker --help'
steps:
- name: Checkout LLVM
uses: actions/checkout at 08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
>From 68ab308ae0aded5ecd53bb4bf3dd6d379d32b8ab Mon Sep 17 00:00:00 2001
From: Tom Stellard <tstellar at redhat.com>
Date: Fri, 7 Nov 2025 09:01:10 -0800
Subject: [PATCH 4/4] Update
.github/workflows/containers/github-action-ci-tooling/Dockerfile
Co-authored-by: Baranov Victor <bar.victor.2002 at gmail.com>
---
.github/workflows/containers/github-action-ci-tooling/Dockerfile | 1 -
1 file changed, 1 deletion(-)
diff --git a/.github/workflows/containers/github-action-ci-tooling/Dockerfile b/.github/workflows/containers/github-action-ci-tooling/Dockerfile
index 7e02d2309e832..be61264b93753 100644
--- a/.github/workflows/containers/github-action-ci-tooling/Dockerfile
+++ b/.github/workflows/containers/github-action-ci-tooling/Dockerfile
@@ -119,4 +119,3 @@ RUN git clone https://github.com/universal-ctags/ctags.git && \
sudo make install && \
rm -Rf ../ctags
-
More information about the llvm-commits
mailing list