Update full-linux-build.yml #116
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: 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) |