From 85efa83292ea083a012aeba497abef7220467a07 Mon Sep 17 00:00:00 2001 From: Tobias Wood Date: Wed, 13 Dec 2023 21:08:07 +0000 Subject: [PATCH] Set up clang-format in CI --- .gitlab-ci.yml | 2 ++ ci/checkformat.gitlab-ci.yml | 11 +++++++++++ 2 files changed, 13 insertions(+) create mode 100644 ci/checkformat.gitlab-ci.yml diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index e5a3c00af..d28f9c726 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -8,6 +8,7 @@ # with this file, You can obtain one at http://mozilla.org/MPL/2.0/. stages: + - checkformat - buildsmoketests - smoketests - build @@ -18,6 +19,7 @@ variables: EIGEN_CI_CMAKE_GENEATOR: "Ninja" include: + - "/ci/checkformat.gitlab-ci.yml" - "/ci/smoketests.gitlab-ci.yml" - "/ci/build.gitlab-ci.yml" - "/ci/test.gitlab-ci.yml" diff --git a/ci/checkformat.gitlab-ci.yml b/ci/checkformat.gitlab-ci.yml new file mode 100644 index 000000000..c4b4c8e91 --- /dev/null +++ b/ci/checkformat.gitlab-ci.yml @@ -0,0 +1,11 @@ +checkformat:clangformat: + stage: checkformat + image: ubuntu:23.10 + only: + - merge_requests + allow_failure: true + before_script: + - apt-get update -y + - apt-get install -y --no-install-recommends git clang-format-17 + script: + - git clang-format-17 --diff --commit ${CI_MERGE_REQUEST_DIFF_BASE_SHA}