From 29a3939c647c0f9d18ccd17843de2fa769a8be14 Mon Sep 17 00:00:00 2001 From: Povilas Kanapickas Date: Wed, 5 Mar 2025 02:46:17 +0200 Subject: [PATCH] chore: Add Github Actions job for checking formatting (#92) --- .github/workflows/check_formatting.yml | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 .github/workflows/check_formatting.yml diff --git a/.github/workflows/check_formatting.yml b/.github/workflows/check_formatting.yml new file mode 100644 index 0000000..7a33ded --- /dev/null +++ b/.github/workflows/check_formatting.yml @@ -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