This repository has been archived by the owner on Jan 15, 2025. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
82 lines (71 loc) · 1.92 KB
/
static_analysis.yml
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
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
name: Static Analysis
on:
push:
branches: [ "main" ]
paths:
- 'src/**'
- 'include/**'
- 'test/**'
pull_request:
branches: [ "main" ]
paths:
- 'src/**'
- 'include/**'
- 'test/**'
jobs:
clang-tidy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
path: bi
- name: Install dependencies
run: |
sudo apt-get update
sudo apt-get install -y clang-tidy
- name: Print clang-tidy version
run: clang-tidy --version
- name: Configure CMake
run: |
cmake -B build \
-DCMAKE_EXPORT_COMPILE_COMMANDS=ON \
-DCMAKE_CXX_COMPILER=clang++ \
-S .
working-directory: bi
- name: Run clang-tidy
run: clang-tidy -p build include/*.hpp include/*.inl src/*.hpp src/*.cpp test/*.hpp test/*.cpp --warnings-as-errors='*'
working-directory: bi
cpplint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
path: bi
- name: Install cpplint
run: pip install cpplint
- name: Print cpplint version
run: pip show cpplint
- name: Run cpplint
run: cpplint --root=.. --extensions=hpp,cpp,inl --headers=hpp,inl --recursive include/ src/ test/
working-directory: bi
clang-format-check:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
path: bi
- name: Install clang-format
run: |
sudo apt-get update
wget https://apt.llvm.org/llvm.sh
sudo chmod +x llvm.sh
sudo ./llvm.sh 17
sudo apt-get install -y clang-format-17
- name: Print clang-format version
run: clang-format-17 --version
- name: Check format
run: |
find include/** src/** test/** -iname '*.hpp' -o -iname '*.cpp' -o -iname '*.inl' | while read file; do
clang-format-17 "$file" | diff "$file" -
done
working-directory: bi