Skip to content

Commit 06184b8

Browse files
committed
ready PR for merging
do thread comments when run as action
1 parent b06637f commit 06184b8

File tree

4 files changed

+24
-19
lines changed

4 files changed

+24
-19
lines changed

.github/workflows/cpp-lint-action.yml

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,9 @@ name: cpp-linter as action
22

33
on:
44
workflow_dispatch:
5+
pull_request:
6+
types: [opened, reopened, synchronize]
7+
push:
58

69

710
jobs:
@@ -28,12 +31,12 @@ jobs:
2831
# - name: Generate compilation database
2932
# if: steps.cache-build.outputs.cache-hit != 'true'
3033
# run: mkdir build && cmake -Bbuild src
31-
34+
3235
# - name: Move database to src folder
3336
# run: mv build/compile_commands.json src/
3437

3538
- name: run linter as action
36-
uses: cpp-linter/cpp-linter-action@backlogged-updates
39+
uses: cpp-linter/cpp-linter-action@latest
3740
id: linter
3841
env:
3942
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
@@ -45,7 +48,7 @@ jobs:
4548
# database: build
4649
verbosity: 9
4750
version: ${{ matrix.clang-version }}
48-
file-annotations: ${{ matrix.clang-version == '12' }}
51+
thread-comments: ${{ matrix.clang-version == '12' }}
4952

5053
- name: Fail fast?!
5154
if: steps.linter.outputs.checks-failed > 0

.github/workflows/cpp-lint-package.yml

Lines changed: 16 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -2,35 +2,38 @@ name: cpp-linter as pkg
22

33
on:
44
workflow_dispatch:
5+
pull_request:
6+
types: [opened, reopened, synchronize]
7+
push:
58

69
jobs:
710
cpp-linter:
811
runs-on: windows-latest
912

1013
strategy:
1114
matrix:
12-
clang-version: ['9','10', '11', '12', '13', '14']
15+
clang-version: ['7', '8', '9','10', '11', '12', '13', '14']
1316
repo: ['cpp-linter/cpp-linter-action']
14-
branch: ['backlogged-updates']
17+
branch: ['latest']
1518
fail-fast: false
1619

1720
steps:
1821

1922
- uses: actions/checkout@v3
2023
with:
2124
submodules: true
22-
- uses: actions/setup-python@v3
25+
26+
- uses: actions/setup-python@v4
27+
28+
- name: install workflow deps
29+
run: python -m pip install clang-tools git+https://github.com/${{ matrix.repo }}/@${{ matrix.branch }}
30+
2331
- name: Install clang-tools
24-
uses: KyleMayes/install-llvm-action@v1
25-
with:
26-
version: ${{ matrix.clang-version }}
27-
directory: ${{ runner.temp }}/llvm
28-
29-
- name: Install linter package
30-
run: python3 -m pip install git+https://github.com/${{ matrix.repo }}/@${{ matrix.branch }}
31-
32-
- uses: seanmiddleditch/gha-setup-vsdevenv@v4
33-
32+
run: clang-tools -install ${{ matrix.clang-version }} --directory ${{ runner.temp }}/llvm
33+
34+
- name: Setup VS dev env
35+
uses: seanmiddleditch/gha-setup-vsdevenv@v4
36+
3437
- name: Cache the build artifacts
3538
id: cache-build
3639
uses: actions/cache@v3

src/demo.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,7 @@ size_t dummyFunc(size_t i) { return i; }
88

99
int main()
1010
{
11-
for (;;)
12-
break;
11+
for (;;) break;
1312

1413
printf("Hello world!\n");
1514

src/demo.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ class Dummy {
99
public:
1010
void *not_usefull(char *str){
1111
useless = str;
12-
return nullptr;
12+
return 0;
1313
}
1414
};
1515

0 commit comments

Comments
 (0)