-
-
Notifications
You must be signed in to change notification settings - Fork 8
51 lines (39 loc) · 1.1 KB
/
codeql.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
name: C++ Code Analysis
on:
push:
branches:
- master
pull_request:
branches:
- master
jobs:
build-and-analyze:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Install C++ tools
run: sudo apt-get update && sudo apt-get install -y clang clang-tidy cppcheck cmake
- name: List directory contents
run: ls -R
- name: Check for CMakeLists.txt
run: |
if [ ! -f ./CMakeLists.txt ]; then
echo "CMakeLists.txt not found in the root directory."
exit 1
fi
- name: Create build directory
run: mkdir build
- name: Run CMake
run: cmake -S . -B build
- name: Build project
run: cmake --build build
- name: Run cppcheck
run: cppcheck --enable=all --inconclusive --xml --xml-version=2 . 2> cppcheck-result.xml
- name: Run clang-tidy
run: find . -name '*.cpp' | xargs clang-tidy -p build
- name: Upload cppcheck results
uses: actions/upload-artifact@v3
with:
name: cppcheck-result
path: cppcheck-result.xml