Skip to content

Commit

Permalink
CI: Add code format checker.
Browse files Browse the repository at this point in the history
  • Loading branch information
heiher committed May 11, 2024
1 parent 01b24f5 commit 177684e
Showing 1 changed file with 25 additions and 0 deletions.
25 changes: 25 additions & 0 deletions .github/workflows/pr-code-format.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
name: "Check code formatting"

on:
pull_request:

jobs:
checker:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 1
- name: Prepare
run: |
wget -O - https://apt.llvm.org/llvm-snapshot.gpg.key | sudo apt-key add -
sudo add-apt-repository -y 'deb http://apt.llvm.org/jammy/ llvm-toolchain-jammy main'
sudo apt install clang-format
- name: Format
run: |
find src -iname "*.[h,c]" -exec clang-format -i {} \;
- name: Check
run: |
git status
git diff --quiet

0 comments on commit 177684e

Please sign in to comment.