From 2691dd4aa3180f0cca6f2a66995ea5c60069b2ad Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?S=C3=A9bastien=20Villemot?= <sebastien@dynare.org>
Date: Wed, 20 Nov 2024 15:53:03 +0100
Subject: [PATCH] CI: add manual clang-tidy job

---
 .gitlab-ci.yml | 11 +++++++++++
 1 file changed, 11 insertions(+)

diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index 104c43795..d9594f3c1 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -184,6 +184,17 @@ test_clang_format:
     - ninja -C build-clang-format clang-format-check
   needs: []
 
+test_clang_tidy:
+  stage: test
+  script:
+    # Hack needed for meson < 1.6.0 which only looks for unversioned clang-tidy
+    - mkdir -p ~/.local/bin && ln -s /usr/bin/clang-tidy-16 ~/.local/bin/clang-tidy
+    - export PATH="$HOME/.local/bin:$PATH"
+    - meson setup -Dbuild_for=octave build-clang-tidy
+    - ninja -C build-clang-tidy clang-tidy
+  needs: []
+  when: manual
+
 # For the sign and deploy jobs, we don’t use the “needs” keyword, since we
 # don’t want those jobs to start before the “test” and “pkg” stages have
 # succeeded. Hence we stick to the “dependencies” keyword.
-- 
GitLab