Skip to content

Update clang-format-check.yml #112

Update clang-format-check.yml

Update clang-format-check.yml #112

name: Clang-Format Check
on:
push:
branches:
- master
pull_request:
jobs:
check-format:
runs-on: ubuntu-latest
steps:
# Step 1: Checkout the code
- uses: actions/checkout@v3
# Step 2: Install clang-format version 19
- name: Install clang-format
run: |
sudo apt-get update
sudo apt-get install -y clang-format-19
sudo ln -sf /usr/bin/clang-format-19 /usr/bin/clang-format
- name: Check clang-format version
run: clang-format --version
# Step 3: Check formatting
- name: Run clang-format
run: |
# Find all .cpp and .hpp files
find . -name '*.cpp' -o -name '*.hpp' > files_to_check.txt
# Check if clang-format would make changes
clang-format --dry-run -Werror $(cat files_to_check.txt)