only test format on changed files and changed lines
authorMatthieu Gallien <matthieu.gallien@nextcloud.com>
Tue, 4 Oct 2022 12:02:47 +0000 (14:02 +0200)
committerMatthieu Gallien <matthieu_gallien@yahoo.fr>
Tue, 4 Oct 2022 16:31:50 +0000 (18:31 +0200)
Signed-off-by: Matthieu Gallien <matthieu.gallien@nextcloud.com>
.github/workflows/clang-format.yml

index 0547ee6434215e47d2b62d88aa35de4f64d5d0e2..77ca2acf0c63c0699380459b3df7252538f9f0eb 100644 (file)
@@ -4,12 +4,17 @@ on:
     types: [opened, synchronize, reopened]
 jobs:
   build:
-    runs-on: ubuntu-latest
-
+    runs-on: ubuntu-22.04
     steps:
     - uses: actions/checkout@v2
-    - uses: DoozyX/clang-format-lint-action@v0.14
+    - uses: cpp-linter/cpp-linter-action@v2.1.1
+      id: linter
+      env:
+        GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
       with:
-        source: '.'
-        extensions: 'h,cpp,c'
-        clangFormatVersion: 14
+        style: file
+        lines-changed-only: true
+        version: 14
+    - name: Fail fast?!
+      if: steps.linter.outputs.checks-failed > 0
+      run: echo "Some files failed the linting checks!"