Add C++ format check to GitHub Actions (#2554)

This commit is contained in:
Patrick Shriwise 2023-06-15 23:03:46 -05:00 committed by GitHub
parent c5bc2302eb
commit 96d150a64e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

25
.github/workflows/format-check.yml vendored Normal file
View file

@ -0,0 +1,25 @@
name: C++ Format Check
on: pull_request
jobs:
cpp-linter:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: cpp-linter/cpp-linter-action@v2
id: linter
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
style: file
files-changed-only: true
tidy-checks: '-*'
version: '15' # clang-format version
file-annotations: true
step-summary: true
extensions: 'cpp,h'
- name: Failure Check
if: steps.linter.outputs.checks-failed > 0
run: echo "Some files failed the formatting check! See job summary and file annotations for more info" && exit 1