Skip to content
This repository has been archived by the owner on Dec 13, 2024. It is now read-only.

Commit

Permalink
ci: add clang-format
Browse files Browse the repository at this point in the history
  • Loading branch information
storopoli committed Jul 28, 2024
1 parent 84e68ec commit 8413c12
Showing 1 changed file with 28 additions and 0 deletions.
28 changes: 28 additions & 0 deletions .github/workflows/clang-format.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
name: clang-format
on:
push:
branches: [ main ]
pull_request:
branches: [ main ]

jobs:
clang-format:
name: Check code formatting using clang-format
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Install dependencies
run: sudo apt-get install clang-format
- name: Check formatting C code
run: |
find . -type f -name "*.c" -exec clang-format -n -Werror --ferror-limit=1 {} ;
- name: Check formatting C++ code
run: |
find . -type f -name "*.c" -exec clang-format -n -Werror --ferror-limit=1 {} ;
- name: Check formatting C header code
run: |
find . -type f -name "*.c" -exec clang-format -n -Werror --ferror-limit=1 {} ;
- name: Check formatting C++ header code
run: |
find . -type f -name "*.c" -exec clang-format -n -Werror --ferror-limit=1 {} ;

0 comments on commit 8413c12

Please sign in to comment.