Skip to content

Commit

Permalink
Add clang-format github action
Browse files Browse the repository at this point in the history
  • Loading branch information
NilsIrl committed Jan 29, 2020
1 parent 8cea230 commit 903026e
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions .github/workflows/format.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
name: Format
on: [push, pull_request]
jobs:
format:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- name: Install dependencies
run: |
curl https://apt.llvm.org/llvm-snapshot.gpg.key | sudo apt-key add -
sudo add-apt-repository -y 'deb http://apt.llvm.org/bionic/ llvm-toolchain-bionic-9 main'
sudo apt install clang-format-9
- name: Format code
run: |
find src/ -type f -name '*.c' -name '*.c' | xargs clang-format-9 -i
git diff-index --quiet HEAD -- || (git diff && exit 1)

0 comments on commit 903026e

Please sign in to comment.