gha: Check formatting using clang-format on push

This commit is contained in:
Magne Sjaastad 2020-06-08 11:08:22 +02:00 committed by GitHub
parent 03ac01d049
commit 64a719b1f4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

23
.github/workflows/clang-format.yml vendored Normal file
View File

@ -0,0 +1,23 @@
name: clang-format
on: [push, pull_request]
jobs:
clang-format-job:
runs-on: ubuntu-latest
steps:
- name: Install clang-format 6.0
run: |
sudo apt install clang-format-6.0
clang-format-6.0 --version
- uses: actions/checkout@v2
- name: Check format
run: |
cd ApplicationCode
find -name "*.h" -o -name "*.cpp" -o -name "*.inl" | xargs clang-format-6.0 -i
git diff
- uses: peter-evans/create-pull-request@v2
with:
token: ${{ secrets.GITHUB_TOKEN }}
commit-message: 'Fixes by clang-format'
title: 'Fixes by clang-format'