From 652f328915439664954812c0c781c5edcaa60f9c Mon Sep 17 00:00:00 2001 From: Joe Date: Tue, 16 Apr 2024 18:54:29 +0100 Subject: [PATCH] Testing out GitHub C++ linter workflow --- .github/workflows/cpp-linter.yml | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 .github/workflows/cpp-linter.yml diff --git a/.github/workflows/cpp-linter.yml b/.github/workflows/cpp-linter.yml new file mode 100644 index 0000000..11b36e2 --- /dev/null +++ b/.github/workflows/cpp-linter.yml @@ -0,0 +1,28 @@ +name: cpp-linter +on: + pull_request: + branches: [main, master, develop] + paths: ['**.c', '**.cpp', '**.h', '**.hpp', '**.cxx', '**.hxx', '**.cc', '**.hh', '**CMakeLists.txt', 'meson.build', '**.cmake'] + push: + branches: [main, master, develop] + paths: ['**.c', '**.cpp', '**.h', '**.hpp', '**.cxx', '**.hxx', '**.cc', '**.hh', '**CMakeLists.txt', 'meson.build', '**.cmake'] + +jobs: + cpp-linter: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + + # ... optionally setup build env to create a compilation database + + - uses: cpp-linter/cpp-linter-action@v2 + id: linter + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + style: '' # disable clang-format checks. + tidy-checks: '' # Use .clang-tidy config file. + + - name: Fail fast?! + if: steps.linter.outputs.clang-tidy-checks-failed > 0 + run: exit 1 \ No newline at end of file