-
Notifications
You must be signed in to change notification settings - Fork 5
118 lines (90 loc) · 3.51 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
116
117
118
name: code analysis
on: [push, pull_request]
jobs:
core-guidelines:
name: core-guidelines-check
runs-on: windows-2022
# Allow failures because of the internal compiler error with reference_lines.cpp
continue-on-error: true
defaults:
run:
working-directory: ${{ github.workspace }}/build
steps:
- name: checkout-repo
uses: actions/checkout@v3
- 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@v2
with:
sarif_file: ${{ steps.run-analysis.outputs.sarif }}
#############################################################################################################
clang-analyzers:
runs-on: ubuntu-22.04
strategy:
matrix:
tool: [
{ name: iwyu, cmake-flag: CMAKE_CXX_INCLUDE_WHAT_YOU_USE="iwyu;-Xiwyu;--mapping_file=../.iwyu-mappings" },
{ 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-15 llvm-15-dev libclang-15-dev clang-tools-15 clang-tidy-15 iwyu cppcheck
cxx: clang++-15
defaults:
run:
working-directory: ${{ github.workspace }}/build
name: ${{ matrix.tool.name }}
steps:
- name: checkout-repo
uses: actions/checkout@v3
- 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@v3
with:
name: ${{ matrix.tool.name }}-analysis-results
path: ${{ github.workspace }}/build/${{ matrix.tool.name }}-out.txt
#############################################################################################################
codeql:
runs-on: ubuntu-22.04
strategy:
matrix:
include:
- pkgs: clang-15 libtbb-dev
cxx: clang++-15
name: codeql
defaults:
run:
working-directory: ${{ github.workspace }}/build
steps:
- name: checkout-repo
uses: actions/checkout@v3
- name: setup-tools
run: sudo apt update && sudo apt install -y ${{ matrix.pkgs }}
- name: setup-codeql
uses: github/codeql-action/init@v2
with:
languages: cpp
queries: security-and-quality
- 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@v2