From 99b2f878bc2f411d37c2fc92c2b878b1c470b304 Mon Sep 17 00:00:00 2001 From: kyrillh Date: Sat, 13 Apr 2024 13:20:37 +0200 Subject: [PATCH] Config for github actions Nothing --- .clang-format | 3 +++ .github/workflows/linter.yaml | 29 +++++++++++++++++++++++++++++ .gitignore | 7 ------- 3 files changed, 32 insertions(+), 7 deletions(-) create mode 100644 .clang-format create mode 100644 .github/workflows/linter.yaml diff --git a/.clang-format b/.clang-format new file mode 100644 index 00000000..70c185ff --- /dev/null +++ b/.clang-format @@ -0,0 +1,3 @@ +IndentWidth: 4 +ColumnLimit: 120 +Language: Cpp diff --git a/.github/workflows/linter.yaml b/.github/workflows/linter.yaml new file mode 100644 index 00000000..cb4d377f --- /dev/null +++ b/.github/workflows/linter.yaml @@ -0,0 +1,29 @@ +# https://github.com/cpp-linter/cpp-linter-action?tab=readme-ov-file +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: 'file' # Use .clang-format config file. + tidy-checks: '' # disable clang-tidy checks. + + - name: Fail fast?! + if: steps.linter.outputs.clang-format-checks-failed > 0 + run: exit 1 diff --git a/.gitignore b/.gitignore index 55119104..0e757478 100644 --- a/.gitignore +++ b/.gitignore @@ -4,10 +4,3 @@ *.dylib /build* /.vscode -.uuid -.cache/ -.idea/ -*.yaml -misc/ -.clang-format -compile_commands.json