From ccaeb65fe94fb7aaaa7d4d5d90e1e7786d788866 Mon Sep 17 00:00:00 2001 From: MomoDeve Date: Mon, 3 Jul 2023 01:18:42 +0300 Subject: [PATCH 1/7] add linter workflow --- .github/workflows/cpp-linter.yml | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 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 000000000..056dc6b09 --- /dev/null +++ b/.github/workflows/cpp-linter.yml @@ -0,0 +1,30 @@ +name: cpp-linter + +on: + push: + paths-ignore: + - "submodules/**" + pull_request: + paths-ignore: + - "submodules/**" + +jobs: + cpp-linter: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - uses: cpp-linter/cpp-linter-action@main + id: linter + continue-on-error: true + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + style: file + files-changed-only: false + + - name: C++ Linter checks failed! + 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 20834e091ef56eb3978428d0ae4253b6a04fff23 Mon Sep 17 00:00:00 2001 From: MomoDeve Date: Mon, 3 Jul 2023 01:23:35 +0300 Subject: [PATCH 2/7] use only for master branch --- .github/workflows/cpp-linter.yml | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/.github/workflows/cpp-linter.yml b/.github/workflows/cpp-linter.yml index 056dc6b09..e644a62c5 100644 --- a/.github/workflows/cpp-linter.yml +++ b/.github/workflows/cpp-linter.yml @@ -2,9 +2,13 @@ name: cpp-linter on: push: + branches: + - main paths-ignore: - "submodules/**" pull_request: + branches: + - main paths-ignore: - "submodules/**" @@ -22,7 +26,7 @@ jobs: style: file files-changed-only: false - - name: C++ Linter checks failed! + - name: C++ Linter check status if: steps.linter.outputs.checks-failed != 0 run: | echo "some linter checks failed. ${{ steps.linter.outputs.checks-failed }}" From 940bbf32e6f59f43e9cb23cdca7b8216e9c5f8a8 Mon Sep 17 00:00:00 2001 From: MomoDeve Date: Mon, 3 Jul 2023 01:24:03 +0300 Subject: [PATCH 3/7] use only for master branch --- .github/workflows/cpp-linter.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/cpp-linter.yml b/.github/workflows/cpp-linter.yml index e644a62c5..0263e23d7 100644 --- a/.github/workflows/cpp-linter.yml +++ b/.github/workflows/cpp-linter.yml @@ -3,12 +3,12 @@ name: cpp-linter on: push: branches: - - main + - master paths-ignore: - "submodules/**" pull_request: branches: - - main + - master paths-ignore: - "submodules/**" From 857739c4b8460670f60a94145b48eb1134e2eff8 Mon Sep 17 00:00:00 2001 From: MomoDeve Date: Mon, 3 Jul 2023 01:28:28 +0300 Subject: [PATCH 4/7] force error --- .github/workflows/cpp-linter.yml | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/.github/workflows/cpp-linter.yml b/.github/workflows/cpp-linter.yml index 0263e23d7..2fa1747b0 100644 --- a/.github/workflows/cpp-linter.yml +++ b/.github/workflows/cpp-linter.yml @@ -29,6 +29,4 @@ jobs: - name: C++ Linter check status 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 + exit 1 \ No newline at end of file From a96570af8c9025d25bc5ef3ff3c9c147d0fa6e72 Mon Sep 17 00:00:00 2001 From: MomoDeve Date: Mon, 3 Jul 2023 01:33:09 +0300 Subject: [PATCH 5/7] output errors --- .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 2fa1747b0..0e1abbd13 100644 --- a/.github/workflows/cpp-linter.yml +++ b/.github/workflows/cpp-linter.yml @@ -29,4 +29,5 @@ jobs: - name: C++ Linter check status if: steps.linter.outputs.checks-failed != 0 run: | + echo "some linter checks failed. ${{ steps.linter.outputs.checks-failed }}" exit 1 \ No newline at end of file From 39219a0cc67f22706af7e2a4cb28fe01918c7bb7 Mon Sep 17 00:00:00 2001 From: MomoDeve Date: Mon, 3 Jul 2023 01:45:53 +0300 Subject: [PATCH 6/7] ignore samples --- .github/workflows/cpp-linter.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/cpp-linter.yml b/.github/workflows/cpp-linter.yml index 0e1abbd13..0505d5522 100644 --- a/.github/workflows/cpp-linter.yml +++ b/.github/workflows/cpp-linter.yml @@ -6,11 +6,13 @@ on: - master paths-ignore: - "submodules/**" + - "samples/**" pull_request: branches: - master paths-ignore: - "submodules/**" + - "samples/**" jobs: cpp-linter: @@ -29,5 +31,5 @@ jobs: - name: C++ Linter check status if: steps.linter.outputs.checks-failed != 0 run: | - echo "some linter checks failed. ${{ steps.linter.outputs.checks-failed }}" + echo "some linter checks failed. ${{ steps.linter.outputs. }}" exit 1 \ No newline at end of file From ea235f737790dc7c399246f8077cb566e9cb9f17 Mon Sep 17 00:00:00 2001 From: MomoDeve Date: Mon, 3 Jul 2023 01:49:39 +0300 Subject: [PATCH 7/7] ignore samples --- .github/workflows/cpp-linter.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/cpp-linter.yml b/.github/workflows/cpp-linter.yml index 0505d5522..51b0eeb4d 100644 --- a/.github/workflows/cpp-linter.yml +++ b/.github/workflows/cpp-linter.yml @@ -31,5 +31,5 @@ jobs: - name: C++ Linter check status if: steps.linter.outputs.checks-failed != 0 run: | - echo "some linter checks failed. ${{ steps.linter.outputs. }}" + echo "some linter checks failed. ${{ steps.linter.outputs.checks-failed }}" exit 1 \ No newline at end of file