Skip to content

Commit

Permalink
Clang format on push
Browse files Browse the repository at this point in the history
  • Loading branch information
korli committed Feb 5, 2025
1 parent 6d26bbd commit f5f821f
Showing 1 changed file with 34 additions and 0 deletions.
34 changes: 34 additions & 0 deletions .github/workflows/codeformat.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
name: Format (clang-format)

on:
push:
branches:
- 'master'
pull_request:
paths:
- '**.h'
- '**.cpp'
- '**.c'

jobs:
clang-format:
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@v4
with:
ref: ${{ github.head_ref }}

- name: Set up clang-format
run: |
wget -O - https://apt.llvm.org/llvm-snapshot.gpg.key | sudo apt-key add -
sudo add-apt-repository "deb http://apt.llvm.org/noble/ llvm-toolchain-noble-19 main"
sudo apt install clang-format-19
- name: Run clang-format
run: |
which clang-format-19
clang-format-19 -i source/*.cpp source/*.h
- uses: stefanzweifel/git-auto-commit-action@v5
with:
commit_message: Apply clang-format changes

0 comments on commit f5f821f

Please sign in to comment.