From 5554bb61509962c4405bbffb09bb5bf024f57cfb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Viliam=20Lej=C4=8D=C3=ADk?= <34658965+lejcik@users.noreply.github.com> Date: Thu, 2 Dec 2021 23:53:01 +0100 Subject: [PATCH 1/9] Create cpp-linter.yml --- .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 00000000..4ee2dc19 --- /dev/null +++ b/.github/workflows/cpp-linter.yml @@ -0,0 +1,28 @@ +name: cpp-linter + +on: + push: + branches: [ master ] + pull_request: + branches: [ master ] + workflow_dispatch: + +jobs: + cpp-linter: + runs-on: ubuntu-latest + steps: + - name: Checkout repository + uses: actions/checkout@v2 + + - name: Install C/C++ Linter + uses: shenxianpeng/cpp-linter-action@master + id: linter + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + style: file + + - name: Fail fast?! + if: steps.linter.outputs.checks-failed > 0 + run: | + echo "Some files failed the linting checks!" From b7398c60bec778ebe825079789c10b2346508d3f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Viliam=20Lej=C4=8D=C3=ADk?= <34658965+lejcik@users.noreply.github.com> Date: Fri, 3 Dec 2021 00:12:50 +0100 Subject: [PATCH 2/9] disabled analysis on changed files only --- .github/workflows/cpp-linter.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/cpp-linter.yml b/.github/workflows/cpp-linter.yml index 4ee2dc19..ef9ce6ad 100644 --- a/.github/workflows/cpp-linter.yml +++ b/.github/workflows/cpp-linter.yml @@ -21,6 +21,7 @@ jobs: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} with: style: file + files-changed-only: false - name: Fail fast?! if: steps.linter.outputs.checks-failed > 0 From 2bb3df5abfe103d3b7d4c15bde9535c6636cca3d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Viliam=20Lej=C4=8D=C3=ADk?= <34658965+lejcik@users.noreply.github.com> Date: Fri, 3 Dec 2021 18:20:53 +0100 Subject: [PATCH 3/9] changed analyzer --- .github/workflows/cpp-linter.yml | 15 +++------------ 1 file changed, 3 insertions(+), 12 deletions(-) diff --git a/.github/workflows/cpp-linter.yml b/.github/workflows/cpp-linter.yml index ef9ce6ad..59b18bf7 100644 --- a/.github/workflows/cpp-linter.yml +++ b/.github/workflows/cpp-linter.yml @@ -14,16 +14,7 @@ jobs: - name: Checkout repository uses: actions/checkout@v2 - - name: Install C/C++ Linter - uses: shenxianpeng/cpp-linter-action@master - id: linter - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + - name: Run static analysis + uses: JacobDomagala/StaticAnalysis@master with: - style: file - files-changed-only: false - - - name: Fail fast?! - if: steps.linter.outputs.checks-failed > 0 - run: | - echo "Some files failed the linting checks!" + exclude_dir: docs From b1f6bb54197769aec00e2bc0e463c26783f73dff Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Viliam=20Lej=C4=8D=C3=ADk?= <34658965+lejcik@users.noreply.github.com> Date: Fri, 3 Dec 2021 18:26:23 +0100 Subject: [PATCH 4/9] fixed compilation issue --- .github/workflows/cpp-linter.yml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/.github/workflows/cpp-linter.yml b/.github/workflows/cpp-linter.yml index 59b18bf7..9eccaee3 100644 --- a/.github/workflows/cpp-linter.yml +++ b/.github/workflows/cpp-linter.yml @@ -14,6 +14,11 @@ jobs: - name: Checkout repository uses: actions/checkout@v2 + - name: Install libsystemd-dev + run: | + sudo apt-get update -y + sudo apt-get install -y libsystemd-dev + - name: Run static analysis uses: JacobDomagala/StaticAnalysis@master with: From a7c45d3a739c1797e938b6cc9120a7c05e8b3abc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Viliam=20Lej=C4=8D=C3=ADk?= <34658965+lejcik@users.noreply.github.com> Date: Fri, 3 Dec 2021 19:20:57 +0100 Subject: [PATCH 5/9] added a missing dependency --- .github/workflows/cpp-linter.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/cpp-linter.yml b/.github/workflows/cpp-linter.yml index 9eccaee3..a9a364ca 100644 --- a/.github/workflows/cpp-linter.yml +++ b/.github/workflows/cpp-linter.yml @@ -14,9 +14,10 @@ jobs: - name: Checkout repository uses: actions/checkout@v2 - - name: Install libsystemd-dev + - name: Install dependencies run: | sudo apt-get update -y + sudo apt-get install -y pkg-config sudo apt-get install -y libsystemd-dev - name: Run static analysis From 013e644dc3ced912fb40c7e0fa11e1b42fd58656 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Viliam=20Lej=C4=8D=C3=ADk?= <34658965+lejcik@users.noreply.github.com> Date: Fri, 3 Dec 2021 19:34:39 +0100 Subject: [PATCH 6/9] another fix attempt --- .github/workflows/cpp-linter.yml | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/.github/workflows/cpp-linter.yml b/.github/workflows/cpp-linter.yml index a9a364ca..bb46d6e9 100644 --- a/.github/workflows/cpp-linter.yml +++ b/.github/workflows/cpp-linter.yml @@ -14,10 +14,16 @@ jobs: - name: Checkout repository uses: actions/checkout@v2 + - name: Checkout PR tree + uses: actions/checkout@v2 + with: + repository: ${{ github.event.pull_request.repository.full_name }} + ref: ${{ github.event.pull_request.sha }} + path: pr_tree + - name: Install dependencies run: | sudo apt-get update -y - sudo apt-get install -y pkg-config sudo apt-get install -y libsystemd-dev - name: Run static analysis From 2710636340b4a429de6edf7fbed6c42c8ecf4756 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Viliam=20Lej=C4=8D=C3=ADk?= <34658965+lejcik@users.noreply.github.com> Date: Fri, 3 Dec 2021 20:01:11 +0100 Subject: [PATCH 7/9] another fix attempt --- .github/workflows/cpp-linter.yml | 13 +------------ 1 file changed, 1 insertion(+), 12 deletions(-) diff --git a/.github/workflows/cpp-linter.yml b/.github/workflows/cpp-linter.yml index bb46d6e9..b8a37a37 100644 --- a/.github/workflows/cpp-linter.yml +++ b/.github/workflows/cpp-linter.yml @@ -14,19 +14,8 @@ jobs: - name: Checkout repository uses: actions/checkout@v2 - - name: Checkout PR tree - uses: actions/checkout@v2 - with: - repository: ${{ github.event.pull_request.repository.full_name }} - ref: ${{ github.event.pull_request.sha }} - path: pr_tree - - - name: Install dependencies - run: | - sudo apt-get update -y - sudo apt-get install -y libsystemd-dev - - name: Run static analysis uses: JacobDomagala/StaticAnalysis@master with: exclude_dir: docs + apt_pckgs: pkg-config libsystemd-dev From b396892c98b0606f59821e7225a1ef7c18363486 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Viliam=20Lej=C4=8D=C3=ADk?= <34658965+lejcik@users.noreply.github.com> Date: Fri, 3 Dec 2021 20:13:07 +0100 Subject: [PATCH 8/9] verbose mode --- .github/workflows/cpp-linter.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/cpp-linter.yml b/.github/workflows/cpp-linter.yml index b8a37a37..813e8c58 100644 --- a/.github/workflows/cpp-linter.yml +++ b/.github/workflows/cpp-linter.yml @@ -19,3 +19,4 @@ jobs: with: exclude_dir: docs apt_pckgs: pkg-config libsystemd-dev + verbose: true From 55e566c66a4a323115352d58e25204cf9b122ebd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Viliam=20Lej=C4=8D=C3=ADk?= <34658965+lejcik@users.noreply.github.com> Date: Fri, 3 Dec 2021 21:10:46 +0100 Subject: [PATCH 9/9] temporary switch to my analyzer fork --- .github/workflows/cpp-linter.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/cpp-linter.yml b/.github/workflows/cpp-linter.yml index 813e8c58..f40531b8 100644 --- a/.github/workflows/cpp-linter.yml +++ b/.github/workflows/cpp-linter.yml @@ -15,7 +15,8 @@ jobs: uses: actions/checkout@v2 - name: Run static analysis - uses: JacobDomagala/StaticAnalysis@master + # uses: JacobDomagala/StaticAnalysis@master + uses: lejcik/StaticAnalysis@master with: exclude_dir: docs apt_pckgs: pkg-config libsystemd-dev