This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Format Check for C++ and Objective-C | |
on: | |
pull_request: | |
paths: | |
- '**/*.cpp' | |
- '**/*.c' | |
- '**/*.h' | |
- '**/*.mm' | |
- '**/*.m' | |
jobs: | |
format-check: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Install clang-format 19 | |
run: sudo wget -qO- https://apt.llvm.org/llvm.sh | sudo bash -s -- 19 | |
- name: Find and Check All Files | |
run: | | |
FILES=$(find . -type f \( -name '*.cpp' -o -name '*.c' -o -name '*.h' -o -name '*.mm' -o -name '*.m' \)) | |
for file in $FILES; do | |
clang-format --dry-run -Werror -style=file $file || exit 1 | |
done |