Skip to content
Merged
Show file tree
Hide file tree
Changes from 5 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .github/workflows/build-ci-container-tooling.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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'

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit: remove this newline to be consistent with the existing entries.

- container-name: abi-tests
test-command: 'cd $HOME && abi-compliance-checker --help'
steps:
- name: Checkout LLVM
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
Expand Down
57 changes: 43 additions & 14 deletions .github/workflows/containers/github-action-ci-tooling/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,28 @@ 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
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/
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

Expand All @@ -63,31 +85,38 @@ USER gha
WORKDIR /home/gha


FROM base AS ci-container-code-lint
FROM ci-container-build-tools AS ci-container-code-lint
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++
# 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 && \
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 \
cmake \
ninja-build && \
abi-compliance-checker \
abi-dumper \
autoconf \
pkg-config && \
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 && \
rm requirements_linting.txt
USER gha
WORKDIR /home/gha
RUN git clone https://github.com/universal-ctags/ctags.git && \
cd ctags && \
./autogen.sh && \
./configure && \
sudo make install && \
rm -Rf ../ctags


21 changes: 4 additions & 17 deletions .github/workflows/llvm-abi-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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) }}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this left over from testing?

Also, it looks like this doesn't exist yet since it hasn't been built/pushed. Do we want to split the workflow changes out?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do you think it should be hard-coded to llvm? I thought maybe there might be some advantage to using the repository owner here.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think I would prefer it that way. We don't support using it elsewhere, so this just adds (a small amount of) complexity for no real benefit from what I can see.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I split out the workflow changes.

strategy:
matrix:
name:
Expand All @@ -87,19 +89,6 @@ jobs:
ref: ${{ github.sha }}
repo: ${{ github.repository }}
steps:
- name: Install Ninja
uses: llvm/actions/install-ninja@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@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
with:
Expand Down Expand Up @@ -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
Expand All @@ -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
Expand Down
Loading