chore: Add Github Actions job for checking formatting (#92)

This commit is contained in:
Povilas Kanapickas 2025-03-05 02:46:17 +02:00 committed by GitHub
parent cb3464170e
commit 29a3939c64
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

24
.github/workflows/check_formatting.yml vendored Normal file
View File

@ -0,0 +1,24 @@
name: Check formatting
on:
push:
branches:
- main
pull_request:
branches:
- main
jobs:
format:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Install dependencies
run: |
sudo apt-get update
sudo apt-get install -y clang-format-19
- name: Check formatting
run: |
clang-format-19 --style=file -i $(git ls-files | fgrep .hpp)
clang-format-19 --style=file -i $(git ls-files | fgrep .cpp)
git diff --exit-code || exit 1