Skip to content

ci(clang-format): add clang-format check workflow #2

ci(clang-format): add clang-format check workflow

ci(clang-format): add clang-format check workflow #2

name: Clang Format Check
on:
pull_request:
push:
branches:
- main
jobs:
clang-format-check:
runs-on: ubuntu-latest
steps:
# Step 1: Checkout the code from the repository
- name: Checkout the code
uses: actions/checkout@v3
# Step 2: Install clang-format 20.0.0
- name: Install clang-format 20.0.0
run: |
sudo apt-get update
sudo apt-get install -y clang-format-20
sudo ln -sf /usr/bin/clang-format-20 /usr/bin/clang-format
# Step 3: Run clang-format
- name: Run clang-format check
run: |
FILES_TO_CHECK=$(find . -name "*.c" -o -name "*.h")
clang-format -i $FILES_TO_CHECK --dry-run --Werror