shithub: choc

Download patch

ref: 6e2d5f924cb23eb3ad2984ce85bdbae702117d0d
parent: 9f14544070d0f7418d5025955526ea363d7f905d
parent: 6e2e50007181ef3cbd332fbffbb95993c0b3b58c
author: Simon Howard <fraggle@soulsphere.org>
date: Wed Jun 8 09:24:16 EDT 2022

Merge pull request #1471 from turol/improve-ci

Improve CI formatting checks

--- a/.github/workflows/cpp-linter.yml
+++ b/.github/workflows/cpp-linter.yml
@@ -4,15 +4,22 @@
 
 on:
   pull_request:
-    types: [opened, reopened]  # let PR-synchronize events be handled by push events
+    types: [opened, reopened, synchronize]
   push:
 
 jobs:
   cpp-linter:
+    strategy:
+      matrix:
+        compiler: [clang]
     runs-on: ubuntu-latest
     steps:
       - uses: actions/checkout@v3
-      - uses: shenxianpeng/cpp-linter-action@v1
+      - name: Install dependencies
+        run: sudo apt-get update && sudo apt-get install libpng-dev libsamplerate0-dev libsdl2-dev libsdl2-image-dev libsdl2-mixer-dev libsdl2-net-dev ninja-build
+      - name: Run cmake to generate compilation database
+        run: cmake -S . -B . -G Ninja -DCMAKE_EXPORT_COMPILE_COMMANDS=1
+      - uses: cpp-linter/cpp-linter-action@v1
         id: linter
         env:
           GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
@@ -19,8 +26,18 @@
         with:
           style: file
           lines-changed-only: true
+          tidy-checks: >-
+            boost-*
+            ,bugprone-*
+            ,performance-*
+            ,readability-*
+            ,portability-*
+            ,modernize-*
+            ,clang-analyzer-*
+            ,cppcoreguidelines-*
+            ,-cppcoreguidelines-avoid-magic-numbers
+            ,-readability-magic-numbers
 
       - name: Fail fast?!
         if: steps.linter.outputs.checks-failed > 0
-        run: |
-          echo "Some files failed the linting checks!"
+        run: exit 1