From fc04d70d459050a4385302b6b40b1c5c8693409b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Florian=20Omn=C3=A8s?= Date: Wed, 26 Jun 2024 11:43:50 +0200 Subject: [PATCH] Check formatting as part of the CI (workflow only) (#2198) --- .github/workflows/clang-format.yml | 36 ++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) create mode 100644 .github/workflows/clang-format.yml diff --git a/.github/workflows/clang-format.yml b/.github/workflows/clang-format.yml new file mode 100644 index 0000000000..9e00892851 --- /dev/null +++ b/.github/workflows/clang-format.yml @@ -0,0 +1,36 @@ +name: Check cpp formatting + +on: + push: + branches: + - develop + - feature/* + - features/* + - fix/* + +jobs: + build: + name: clang-format + + runs-on: ubuntu-24.04 + + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Print version + run: clang-format --version + + - name: clang-format + run: cd src && ./format-code.sh + + - name: git diff + run: | + DIFF=`git status --porcelain` + if [[ $DIFF ]]; then + echo "The following files are not well formatted" + echo "$DIFF" + exit 1 + else + echo "Code is well formatted, congrats !" + fi