Skip to content

Commit

Permalink
Add clang-format check (#70)
Browse files Browse the repository at this point in the history
- Add job to CI pipeline to run clang-format on modified files
  to see if there are any formatting errors.

Signed-off-by: Derek G Foster <[email protected]>
  • Loading branch information
ffoulkes authored Nov 14, 2023
1 parent cbe4be2 commit b6c5c63
Showing 1 changed file with 25 additions and 0 deletions.
25 changes: 25 additions & 0 deletions .github/workflows/pipeline.yml
Original file line number Diff line number Diff line change
Expand Up @@ -93,3 +93,28 @@ jobs:
export SDE_INSTALL=$SDE_INSTALL_DIR
cmake -S . -B build -C pipeline.cmake -DTDI_TARGET=DPDK
cmake --build build --target krnlmon-test
#---------------------------------------------------------------------
# check_clang_format
#---------------------------------------------------------------------
check_clang_format:
runs-on: ubuntu-latest

steps:
- name: Check out krnlmon repository
uses: actions/checkout@v3

- name: Get list of changed Files
id: changes
uses: tj-actions/changed-files@v40
with:
files: |
**.c
**.h
**.cc
- name: Check for formatting errors
run: |
for file in ${{ steps.changes.outputs.all_changed_files }}; do
clang-format --dry-run -Werror $file
done

0 comments on commit b6c5c63

Please sign in to comment.