Skip to content

Commit 43dd0ae

Browse files
committed
Build: fix static analysis workflow logic.
1 parent d1fadf5 commit 43dd0ae

File tree

1 file changed

+5
-10
lines changed

1 file changed

+5
-10
lines changed

.github/workflows/static.yaml

Lines changed: 5 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,7 @@ on:
55

66
jobs:
77
clang-tidy:
8-
runs-on: self-hosted
9-
if: github.repository_owner == 'deepmodeling'
8+
runs-on: ubuntu-latest
109
container: ghcr.io/deepmodeling/abacus-development-kit:gnu
1110
steps:
1211
- name: Checkout Pull Request
@@ -19,20 +18,16 @@ jobs:
1918
- name: Generate Build Commands
2019
run: |
2120
cmake -B build -DCMAKE_EXPORT_COMPILE_COMMANDS=1
22-
- name: Checkout Changed Files
23-
id: files
24-
uses: deepmodeling/get-changed-files@master
2521
- name: Run clang-tidy
2622
run: |
27-
printf "%s\n" ${{ steps.files.outputs.added_modified }} | grep -E "^.*\.(cpp|h)$" > cppfiles.txt
28-
clang-tidy -p=build --export-fixes=diagnostics.yaml `cat cppfiles.txt`
29-
- name: Run clang-tidy-pr-comments action
30-
uses: deepmodeling/abacus-code-reviewer@master
23+
git diff -U0 HEAD^ | clang-tidy-diff -p1 -path build -export-fixes fixes.yml
24+
- name: Pull request comments from clang-tidy reports
25+
uses: platisd/[email protected]
3126
with:
3227
# The GitHub token (or a personal access token)
3328
github_token: ${{ secrets.GITHUB_TOKEN }}
3429
# The path to the clang-tidy fixes generated previously
35-
clang_tidy_fixes: diagnostics.yaml
30+
clang_tidy_fixes: fixes.yml
3631
# Optionally set to true if you want the Action to request
3732
# changes in case warnings are found
3833
request_changes: true

0 commit comments

Comments
 (0)