syntax #65
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 | |
on: | |
push: | |
branches: | |
- master | |
- "release/v[0-9].[0-9].[0-9]" | |
- "feature/**" | |
# Manual trigger | |
workflow_dispatch: | |
jobs: | |
clang_format: | |
runs-on: ubuntu-latest | |
name: Clang Format | |
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: | | |
${{ 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 |