ci: add clang-tidy development headers to Fedora base image

Prepare to build our own clang-tidy plugin in CI.
This commit is contained in:
Kyle Edwards
2022-08-31 14:02:14 -04:00
committed by Brad King
parent 8c6794abc7
commit 703f39354e
3 changed files with 28 additions and 1 deletions

View File

@@ -4,6 +4,12 @@ MAINTAINER Ben Boeckel <ben.boeckel@kitware.com>
COPY install_rvm.sh /root/install_rvm.sh
RUN sh /root/install_rvm.sh
FROM fedora:36 AS clang-tidy-headers
MAINTAINER Kyle Edwards <kyle.edwards@kitware.com>
COPY install_clang_tidy_headers.sh /root/install_clang_tidy_headers.sh
RUN sh /root/install_clang_tidy_headers.sh
FROM fedora:36
MAINTAINER Ben Boeckel <ben.boeckel@kitware.com>
@@ -13,3 +19,6 @@ RUN sh /root/install_deps.sh
COPY --from=rvm-build /root/rvm.tar /root/rvm.tar
RUN tar -C /usr/local -xf /root/rvm.tar \
&& rm /root/rvm.tar
COPY --from=clang-tidy-headers /root/clang-tidy-headers.tar /root/clang-tidy-headers.tar
RUN tar -C /usr/include -xf /root/clang-tidy-headers.tar \
&& rm /root/clang-tidy-headers.tar

View File

@@ -0,0 +1,18 @@
#!/bin/sh
set -e
# Packages for building the clang-tidy plugin.
# TODO: Upstream this as a proper Fedora package.
dnf install --setopt=install_weak_deps=False -y \
'dnf-command(download)' \
rpm-build \
python3-devel \
clang-tools-extra
clang_source_rpm=$(rpm -q --queryformat '%{SOURCERPM}' clang-tools-extra)
clang_version=$(rpm -q --queryformat '%{VERSION}' clang-tools-extra)
dnf download --source -y clang
rpm -i "$clang_source_rpm"
rpmbuild -bp /root/rpmbuild/SPECS/clang.spec
cd "/root/rpmbuild/BUILD/clang-tools-extra-$clang_version.src"
find clang-tidy -name '*.h' | tar -cf /root/clang-tidy-headers.tar -T -

View File

@@ -69,7 +69,7 @@
### Fedora
.fedora36:
image: "kitware/cmake:ci-fedora36-x86_64-2022-08-30"
image: "kitware/cmake:ci-fedora36-x86_64-2022-08-31"
variables:
GIT_CLONE_PATH: "$CI_BUILDS_DIR/cmake ci/long file name for testing purposes"