Skip to content

Commit

Permalink
Check formatting as part of the CI (workflow only) (#2198)
Browse files Browse the repository at this point in the history
  • Loading branch information
flomnes authored Jun 26, 2024
1 parent 41b3f45 commit fc04d70
Showing 1 changed file with 36 additions and 0 deletions.
36 changes: 36 additions & 0 deletions .github/workflows/clang-format.yml
Original file line number Diff line number Diff line change
@@ -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

0 comments on commit fc04d70

Please sign in to comment.