39 lines (37 loc) · 1.41 KB
/
static.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
name: Static Analysis
on:
pull_request_target:
jobs:
clang-tidy:
runs-on: ubuntu-latest
container: ghcr.io/deepmodeling/abacus-gnu
steps:
- name: Checkout Pull Request
uses: actions/checkout@v4
with:
fetch-depth: 2
- name: Setup clang-tidy
run: |
apt-get update && apt-get install -y --no-install-recommends clang-format clang-tidy
- name: Generate Build Commands
run: |
cmake -B build -DCMAKE_EXPORT_COMPILE_COMMANDS=1
- name: Run clang-tidy
run: |
git config --global --add safe.directory /__w/abacus-develop/abacus-develop
git diff -U0 HEAD^ | clang-tidy-diff -p1 -path build -export-fixes fixes.yml
- name: Pull request comments from clang-tidy reports
uses: platisd/clang-tidy-pr-comments@master
with:
# The GitHub token (or a personal access token)
github_token: ${{ secrets.GITHUB_TOKEN }}
# The path to the clang-tidy fixes generated previously
clang_tidy_fixes: fixes.yml
# Optionally set to true if you want the Action to request
# changes in case warnings are found
request_changes: false
# Optionally set the number of comments per review
# to avoid GitHub API timeouts for heavily loaded
# pull requests
suggestions_per_comment: 10
repo_path_prefix: /__w