diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 895026b..05f8611 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -9,6 +9,22 @@ on: branches: [main] jobs: + check_formatting: + runs-on: ubuntu-latest + container: + image: archlinux:latest + steps: + - uses: actions/checkout@v2 + - name: Install dependencies + run: pacman --noconfirm -Syu findutils git clang + - name: Run clang-format on all C and C++ sources + run: find . -type f -iname "*.c" -or -iname "*.cc" -or -iname "*.cpp" -or -iname "*.h" -exec clang-format -i {} \; + - name: Check whether there are differences + run: | + if [[ -n "$(git status -s)" ]]; then + printf "Files are not properly formatted!\n" + git diff + fi build_arch_linux_jack1: runs-on: ubuntu-latest container: