Skip to content

Update full-linux-build.yml #114

Update full-linux-build.yml

Update full-linux-build.yml #114

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: |
wget -O - https://apt.llvm.org/llvm-snapshot.gpg.key | sudo apt-key add -
sudo add-apt-repository "deb http://apt.llvm.org/jammy/ llvm-toolchain-jammy-19 main"
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)