summaryrefslogtreecommitdiffstats
path: root/.gitlab/ci
diff options
context:
space:
mode:
authorKyle Edwards <kyle.edwards@kitware.com>2022-08-31 18:02:14 (GMT)
committerBrad King <brad.king@kitware.com>2022-08-31 19:07:20 (GMT)
commit703f39354e33e535488cf1bd0ccd3b3b7f5c99ca (patch)
tree2c434111b974c745d52baf23c1ab1668eb42dab5 /.gitlab/ci
parent8c6794abc724d797e1470515e82d791f3baa8ea9 (diff)
downloadCMake-703f39354e33e535488cf1bd0ccd3b3b7f5c99ca.zip
CMake-703f39354e33e535488cf1bd0ccd3b3b7f5c99ca.tar.gz
CMake-703f39354e33e535488cf1bd0ccd3b3b7f5c99ca.tar.bz2
ci: add clang-tidy development headers to Fedora base image
Prepare to build our own clang-tidy plugin in CI.
Diffstat (limited to '.gitlab/ci')
-rw-r--r--.gitlab/ci/docker/fedora36/Dockerfile9
-rwxr-xr-x.gitlab/ci/docker/fedora36/install_clang_tidy_headers.sh18
2 files changed, 27 insertions, 0 deletions
diff --git a/.gitlab/ci/docker/fedora36/Dockerfile b/.gitlab/ci/docker/fedora36/Dockerfile
index 26f8e3e..299d48a 100644
--- a/.gitlab/ci/docker/fedora36/Dockerfile
+++ b/.gitlab/ci/docker/fedora36/Dockerfile
@@ -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
diff --git a/.gitlab/ci/docker/fedora36/install_clang_tidy_headers.sh b/.gitlab/ci/docker/fedora36/install_clang_tidy_headers.sh
new file mode 100755
index 0000000..b9883f4
--- /dev/null
+++ b/.gitlab/ci/docker/fedora36/install_clang_tidy_headers.sh
@@ -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 -