Skip to content

Commit

Permalink
GH Actions: Add check that source code is formatted (by clang-format)
Browse files Browse the repository at this point in the history
Issue #395 (bdwgc).
  • Loading branch information
ivmai committed Oct 3, 2024
1 parent 2fe9d2e commit 8a5ecca
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions .github/workflows/clang-format-check.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# Workflow for checking that source code is formatted by clang-format.
name: clang-format check

on: [ push, pull_request ]

jobs:
build:
name: Check by clang-format
runs-on: ubuntu-latest

steps:
- name: Checkout
uses: actions/checkout@v4
- name: Show clang-format version
run: >
clang-format --version
- name: Perform checking by clang-format
run: >
find . -iname '*.c' -o -iname '*.cc' -o -iname '*.cpp' -o -iname '*.h'
| xargs clang-format --dry-run --Werror

0 comments on commit 8a5ecca

Please sign in to comment.