Skip to content

Commit 0008411

Browse files
committed
test codestyle.yml
1 parent d9dfae2 commit 0008411

File tree

1 file changed

+13
-17
lines changed

1 file changed

+13
-17
lines changed

.github/workflows/codestyle.yml

Lines changed: 13 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -7,26 +7,22 @@ on:
77
jobs:
88
clang-format:
99
runs-on: ubuntu-latest
10+
strategy:
11+
matrix:
12+
path:
13+
- check: 'LuaParser'
14+
- check: 'CodeFormatCode'
15+
- check: 'CodeFormatLib'
16+
- check: 'CodeFormat'
17+
- check: 'CodeFormatServer'
1018
steps:
1119
- name: Checkout code
1220
uses: actions/checkout@v3
1321
with:
1422
ref: ${{ github.event.pull_request.head.sha }}
15-
- name: Install ClangFormat
16-
run: sudo apt-get install -y clang-format
17-
- name: Run ClangFormat
18-
run: clang-format -style=file -output-replacements-xml $(find . -name '*.cpp' -or -name '*.h' -not -path "./3rd/*" -not -path "./Test/*" -not -path "./Test2/*") | grep -c '<replacement ' > /tmp/clang-format-result
19-
- name: Comment on pull request
20-
uses: actions/github-script@v4
23+
- name: Clang Format Checker
24+
- uses: jidicula/[email protected]
2125
with:
22-
github-token: ${{ secrets.GITHUB_TOKEN }}
23-
script: |
24-
const fs = require('fs');
25-
const result = fs.readFileSync('/tmp/clang-format-result', 'utf8');
26-
const comment = `ClangFormat check found ${result} formatting issues.`;
27-
github.issues.createComment({
28-
issue_number: context.issue.number,
29-
owner: context.repo.owner,
30-
repo: context.repo.repo,
31-
body: comment
32-
});
26+
clang-format-version: '17'
27+
check-path: ${{ matrix.path['check'] }}
28+
fallback-style: 'file'

0 commit comments

Comments
 (0)