From a368b3db5be58af77158e909b3daa6eb1db37aaf Mon Sep 17 00:00:00 2001 From: Benedikt Galbavy Date: Mon, 27 May 2024 12:29:51 +0200 Subject: [PATCH 01/12] linter action first test due to how actions work this will spam commits --- .github/workflows/cpp-linter.yaml | 37 +++++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) create mode 100644 .github/workflows/cpp-linter.yaml diff --git a/.github/workflows/cpp-linter.yaml b/.github/workflows/cpp-linter.yaml new file mode 100644 index 0000000..6c4a524 --- /dev/null +++ b/.github/workflows/cpp-linter.yaml @@ -0,0 +1,37 @@ +on: + push: + paths: + - "docs/examples/demo/*" + pull_request: + paths: + - "docs/examples/demo/*" + + permissions: + pull-requests: write + metadata: read + contents: write + +jobs: + cpp-linter: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: cpp-linter/cpp-linter-action@main + id: linter + continue-on-error: true + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + style: 'file' + tidy-checks: '' + files-changed-only: false + thread-comments: false #${{ github.event_name == 'pull_request' && 'update' }} + tidy-review: true + format-review: true + + - name: Fail fast?! + if: steps.linter.outputs.checks-failed != 0 + run: | + echo "some linter checks failed. ${{ steps.linter.outputs.checks-failed }}" + # for actual deployment + # run: exit 1 \ No newline at end of file From d66c860a5d4746bdf10328509d646b3e6926632f Mon Sep 17 00:00:00 2001 From: Benedikt Galbavy Date: Mon, 27 May 2024 12:38:40 +0200 Subject: [PATCH 02/12] updated trigger condition --- .github/workflows/cpp-linter.yaml | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/.github/workflows/cpp-linter.yaml b/.github/workflows/cpp-linter.yaml index 6c4a524..0bf7e74 100644 --- a/.github/workflows/cpp-linter.yaml +++ b/.github/workflows/cpp-linter.yaml @@ -1,10 +1,9 @@ on: push: paths: - - "docs/examples/demo/*" + paths: ['**.c', '**.cpp', '**.h', '**.hpp', '**.cxx', '**.hxx', '**.cc', '**.hh', '**CMakeLists.txt', 'meson.build', '**.cmake'] pull_request: - paths: - - "docs/examples/demo/*" + paths: ['**.c', '**.cpp', '**.h', '**.hpp', '**.cxx', '**.hxx', '**.cc', '**.hh', '**CMakeLists.txt', 'meson.build', '**.cmake'] permissions: pull-requests: write From ba3f199a90b99434debebdadadf2e630558135e0 Mon Sep 17 00:00:00 2001 From: Benedikt Galbavy Date: Mon, 27 May 2024 12:39:10 +0200 Subject: [PATCH 03/12] hotfix: typo --- .github/workflows/cpp-linter.yaml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/cpp-linter.yaml b/.github/workflows/cpp-linter.yaml index 0bf7e74..14a84ef 100644 --- a/.github/workflows/cpp-linter.yaml +++ b/.github/workflows/cpp-linter.yaml @@ -1,6 +1,5 @@ on: push: - paths: paths: ['**.c', '**.cpp', '**.h', '**.hpp', '**.cxx', '**.hxx', '**.cc', '**.hh', '**CMakeLists.txt', 'meson.build', '**.cmake'] pull_request: paths: ['**.c', '**.cpp', '**.h', '**.hpp', '**.cxx', '**.hxx', '**.cc', '**.hh', '**CMakeLists.txt', 'meson.build', '**.cmake'] From f0c1702a2ea20163706b86cc53b0ea07780af431 Mon Sep 17 00:00:00 2001 From: Benedikt Galbavy Date: Mon, 27 May 2024 12:44:32 +0200 Subject: [PATCH 04/12] updated trigger conditions --- .github/workflows/cpp-linter.yaml | 2 -- 1 file changed, 2 deletions(-) diff --git a/.github/workflows/cpp-linter.yaml b/.github/workflows/cpp-linter.yaml index 14a84ef..5d3cd2a 100644 --- a/.github/workflows/cpp-linter.yaml +++ b/.github/workflows/cpp-linter.yaml @@ -1,8 +1,6 @@ on: push: - paths: ['**.c', '**.cpp', '**.h', '**.hpp', '**.cxx', '**.hxx', '**.cc', '**.hh', '**CMakeLists.txt', 'meson.build', '**.cmake'] pull_request: - paths: ['**.c', '**.cpp', '**.h', '**.hpp', '**.cxx', '**.hxx', '**.cc', '**.hh', '**CMakeLists.txt', 'meson.build', '**.cmake'] permissions: pull-requests: write From cfaec58452c3070ae77cc058d13c2a700508a2c3 Mon Sep 17 00:00:00 2001 From: Benedikt Galbavy Date: Mon, 27 May 2024 13:15:05 +0200 Subject: [PATCH 05/12] ghaction added gen of compile commands --- .github/workflows/cpp-linter.yaml | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/.github/workflows/cpp-linter.yaml b/.github/workflows/cpp-linter.yaml index 5d3cd2a..002e0f3 100644 --- a/.github/workflows/cpp-linter.yaml +++ b/.github/workflows/cpp-linter.yaml @@ -12,16 +12,25 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 + with: + submodules: 'true' + - name: Generate compile-commands + uses: threeal/cmake-action@main + with: + build-dir: 'build' + run-build: false + options: 'CMAKE_EXPORT_COMPILE_COMMANDS=1' - uses: cpp-linter/cpp-linter-action@main id: linter continue-on-error: true env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} with: + database: 'build' style: 'file' tidy-checks: '' files-changed-only: false - thread-comments: false #${{ github.event_name == 'pull_request' && 'update' }} + thread-comments: ${{ github.event_name == 'pull_request' && 'update' }} tidy-review: true format-review: true From 61fa90ac5bb54e9972b9eac0c3b2e8d7f0b08562 Mon Sep 17 00:00:00 2001 From: Benedikt Galbavy Date: Mon, 27 May 2024 13:17:34 +0200 Subject: [PATCH 06/12] ghaction added recursive checkout of submodules --- .github/workflows/cpp-linter.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/cpp-linter.yaml b/.github/workflows/cpp-linter.yaml index 002e0f3..ad9fb04 100644 --- a/.github/workflows/cpp-linter.yaml +++ b/.github/workflows/cpp-linter.yaml @@ -13,7 +13,7 @@ jobs: steps: - uses: actions/checkout@v4 with: - submodules: 'true' + submodules: 'recursive' - name: Generate compile-commands uses: threeal/cmake-action@main with: From 23ff2c51ec2ca9f2e19eb7cadd77012f4acbeee8 Mon Sep 17 00:00:00 2001 From: Benedikt Galbavy Date: Mon, 27 May 2024 13:27:50 +0200 Subject: [PATCH 07/12] ghactions modified run options --- .github/workflows/cpp-linter.yaml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/cpp-linter.yaml b/.github/workflows/cpp-linter.yaml index ad9fb04..149a311 100644 --- a/.github/workflows/cpp-linter.yaml +++ b/.github/workflows/cpp-linter.yaml @@ -26,11 +26,13 @@ jobs: env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} with: - database: 'build' style: 'file' tidy-checks: '' + version: 18 files-changed-only: false + ignore: 'docs | build' thread-comments: ${{ github.event_name == 'pull_request' && 'update' }} + database: 'build' tidy-review: true format-review: true From eb54fe6a12aba490583feabbe3e4f468f80c1562 Mon Sep 17 00:00:00 2001 From: Benedikt Galbavy Date: Mon, 27 May 2024 13:32:42 +0200 Subject: [PATCH 08/12] ghaction fixed yaml indentations --- .github/workflows/cpp-linter.yaml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/cpp-linter.yaml b/.github/workflows/cpp-linter.yaml index 149a311..6489886 100644 --- a/.github/workflows/cpp-linter.yaml +++ b/.github/workflows/cpp-linter.yaml @@ -2,10 +2,10 @@ on: push: pull_request: - permissions: - pull-requests: write - metadata: read - contents: write +permissions: + pull-requests: write + metadata: read + contents: write jobs: cpp-linter: From fb0fb08fd4d5eeb68d6808a8aa2946510c2fa72d Mon Sep 17 00:00:00 2001 From: Benedikt Galbavy Date: Mon, 27 May 2024 13:34:03 +0200 Subject: [PATCH 09/12] ghaction hotfix reverted prev change --- .github/workflows/cpp-linter.yaml | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/.github/workflows/cpp-linter.yaml b/.github/workflows/cpp-linter.yaml index 6489886..8c77d85 100644 --- a/.github/workflows/cpp-linter.yaml +++ b/.github/workflows/cpp-linter.yaml @@ -2,13 +2,12 @@ on: push: pull_request: -permissions: - pull-requests: write - metadata: read - contents: write - jobs: cpp-linter: + permissions: + pull-requests: write + metadata: read + contents: write runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 From 83969ea6e1a8d262869de17524fa20294b5c280d Mon Sep 17 00:00:00 2001 From: Benedikt Galbavy Date: Mon, 27 May 2024 13:35:32 +0200 Subject: [PATCH 10/12] ghaction removed unneeded option --- .github/workflows/cpp-linter.yaml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/cpp-linter.yaml b/.github/workflows/cpp-linter.yaml index 8c77d85..55f3993 100644 --- a/.github/workflows/cpp-linter.yaml +++ b/.github/workflows/cpp-linter.yaml @@ -6,7 +6,6 @@ jobs: cpp-linter: permissions: pull-requests: write - metadata: read contents: write runs-on: ubuntu-latest steps: From 920cf8ec236fcfd0c4ad91ad47f76b2b4a9c06b6 Mon Sep 17 00:00:00 2001 From: Benedikt Galbavy Date: Mon, 27 May 2024 14:34:47 +0200 Subject: [PATCH 11/12] ghaction specified clang to treat code as c++ --- .github/workflows/cpp-linter.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/cpp-linter.yaml b/.github/workflows/cpp-linter.yaml index 55f3993..6b4f6f1 100644 --- a/.github/workflows/cpp-linter.yaml +++ b/.github/workflows/cpp-linter.yaml @@ -31,6 +31,7 @@ jobs: ignore: 'docs | build' thread-comments: ${{ github.event_name == 'pull_request' && 'update' }} database: 'build' + extra-args: '-xc++' tidy-review: true format-review: true From 2ec175d6ad8915e5be3c504681e4ea8bdf0f6ecb Mon Sep 17 00:00:00 2001 From: Benedikt Galbavy Date: Mon, 27 May 2024 14:58:58 +0200 Subject: [PATCH 12/12] ghaction debug upload comp cmd json --- .github/workflows/cpp-linter.yaml | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/.github/workflows/cpp-linter.yaml b/.github/workflows/cpp-linter.yaml index 6b4f6f1..2260d15 100644 --- a/.github/workflows/cpp-linter.yaml +++ b/.github/workflows/cpp-linter.yaml @@ -18,6 +18,10 @@ jobs: build-dir: 'build' run-build: false options: 'CMAKE_EXPORT_COMPILE_COMMANDS=1' + - uses: actions/upload-artifact@v4 + with: + name: compile_commands + path: /home/runner/work/Engine/Engine/build - uses: cpp-linter/cpp-linter-action@main id: linter continue-on-error: true @@ -36,7 +40,7 @@ jobs: format-review: true - name: Fail fast?! - if: steps.linter.outputs.checks-failed != 0 + if: steps.linter.outputs.checks-failed > 0 run: | echo "some linter checks failed. ${{ steps.linter.outputs.checks-failed }}" # for actual deployment