-
Notifications
You must be signed in to change notification settings - Fork 5
115 lines (87 loc) · 3.32 KB
/
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
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
name: code analysis
on: [push, pull_request]
jobs:
core-guidelines:
name: core-guidelines-check
runs-on: windows-2022
defaults:
run:
working-directory: ${{ github.workspace }}/build
steps:
- name: checkout-repo
uses: actions/checkout@v4
- name: setup-cmake
run: cmake .. -DCMAKE_BUILD_TYPE=Release -DBUILD_TESTING=OFF
- name: cpp-core-guidelines-check
uses: microsoft/msvc-code-analysis-action@v0.1.1
id: run-analysis
with:
ruleset: ${{ github.workspace }}/core-guidelines.ruleset
cmakeBuildDirectory: ${{ github.workspace }}/build
buildConfiguration: Release
ignoredPaths: ${{ github.workspace }}/test;${{ github.workspace }}/examples
- name: upload-sarif
uses: github/codeql-action/upload-sarif@v3
with:
sarif_file: ${{ steps.run-analysis.outputs.sarif }}
#############################################################################################################
clang-analyzers:
runs-on: ubuntu-24.04
strategy:
matrix:
tool: [
{ name: clang-tidy, cmake-flag: CMAKE_CXX_CLANG_TIDY="clang-tidy" },
{ name: cppcheck, cmake-flag: CMAKE_CXX_CPPCHECK="cppcheck;--version;--verbose;--report-progress;--enable=all;--error-exitcode=1;--std=c++20;--suppressions-list=../.cppcheck-supressions" }
]
include:
- pkgs: clang-18 clang-tools-18 clang-tidy-18 iwyu cppcheck
cxx: clang++-18
defaults:
run:
working-directory: ${{ github.workspace }}/build
name: ${{ matrix.tool.name }} (${{ matrix.cxx }})
steps:
- name: checkout-repo
uses: actions/checkout@v4
- name: setup-tools
run: sudo apt update && sudo apt install -y ${{ matrix.pkgs }}
- name: setup-analysis
env:
CXX: ${{ matrix.cxx }}
run: cmake .. -DCMAKE_BUILD_TYPE=RelWithDebInfo -DBUILD_TESTING=OFF -D${{ matrix.tool.cmake-flag }}
- name: run-analysis
run: cmake --build . --parallel --target gapp 2>&1 | tee ${{ matrix.tool.name }}-out.txt
- uses: actions/upload-artifact@v4
with:
name: ${{ matrix.tool.name }}-analysis-results
path: ${{ github.workspace }}/build/${{ matrix.tool.name }}-out.txt
#############################################################################################################
codeql:
runs-on: ubuntu-24.04
strategy:
matrix:
include:
- pkgs: clang-18
cxx: clang++-18
name: codeql (${{ matrix.cxx }})
defaults:
run:
working-directory: ${{ github.workspace }}/build
steps:
- name: checkout-repo
uses: actions/checkout@v4
- name: setup-tools
run: sudo apt update && sudo apt install -y ${{ matrix.pkgs }}
- name: setup-codeql
uses: github/codeql-action/init@v3
with:
languages: cpp
config-file: ${{ github.workspace }}/.github/codeql/codeql-config.yml
- name: setup-build
env:
CXX: ${{ matrix.cxx }}
run: cmake .. -DCMAKE_BUILD_TYPE=RelWithDebInfo -DBUILD_TESTING=OFF
- name: build
run: cmake --build . --target gapp
- name: run-analysis
uses: github/codeql-action/analyze@v3