Skip to content

Revert "Introduce a formatting error to make the workflow fail" #3

Revert "Introduce a formatting error to make the workflow fail"

Revert "Introduce a formatting error to make the workflow fail" #3

Workflow file for this run

name: Clang Format
on:
push:
branches:
- master
- "feature/**"
jobs:
clang_format:
runs-on: ubuntu-22.04
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Install clang-format
run: |
sudo apt-get update
sudo apt-get install -y clang-format
- name: Check code formatting
run: |
chmod +x ${{ github.workspace }}/scripts/clang-format/format.sh
${{ github.workspace }}/scripts/clang-format/format.sh \
--clang_format_file ${{ github.workspace }}/.clang-format \
--directories ${{ github.workspace }}/src ${{ github.workspace }}/include ${{ github.workspace }}/tests
clang_format_diff=$(git diff)
if [[ -n "$clang_format_diff" ]]; then
echo "Found formatting errors:"
echo "$clang_format_diff"
exit 1
fi