diff --git a/.github/workflows/format-check.yml b/.github/workflows/format-check.yml new file mode 100644 index 0000000000..4914d5e5ea --- /dev/null +++ b/.github/workflows/format-check.yml @@ -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