Skip to content

Commit

Permalink
Check formatting in CI
Browse files Browse the repository at this point in the history
.github/workflows/build.yml:
Use an Arch Linux container to check the formatting using clang-format.
  • Loading branch information
dvzrv committed Jan 4, 2022
1 parent b0b16ca commit 88660e7
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down

0 comments on commit 88660e7

Please sign in to comment.