-
Notifications
You must be signed in to change notification settings - Fork 22
184 lines (150 loc) · 6.3 KB
/
analyzers.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
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
name: Analyzers/sanitizers
on:
workflow_run:
workflows:
- "CI v2"
types:
- completed
jobs:
pvs:
if: github.repository_owner == 'victimsnino' && github.event.workflow_run.conclusion == 'success'
runs-on: ubuntu-latest
timeout-minutes: 10
steps:
- uses: haya14busa/action-workflow_run-status@main
- uses: actions/checkout@v4
with:
token: ${{ secrets.GITHUB_TOKEN }}
fetch-depth: 0
repository: ${{ github.event.workflow_run.head_repository.full_name }}
ref: ${{ github.event.workflow_run.head_branch }}
# Work around https://github.com/actions/runner-images/issues/8659
# - name: "Remove GCC 13 from runner image (workaround)"
# shell: bash
# run: |
# sudo apt-get update
# sudo apt-get purge -y g++-13 gcc-13 libstdc++-13-dev
# sudo apt-get install -y --allow-downgrades libstdc++-12-dev libstdc++6=12.* libgcc-s1=12.*
- name: Install Qt
uses: jurplel/install-qt-action@v4
with:
cache: true
- name: get conan
uses: turtlebrowser/get-conan@main
- name: cache deps
uses: actions/cache@v4
with:
path: |
~/.conan2
/Users/runner/.conan2/
key: deps-ci-ubuntu-clang-Release-${{ hashFiles('**/conanfile.py') }}
restore-keys: deps-ci-ubuntu-clang-Release
- name: conan detect profile
run: |
conan profile detect --force
- name: Install tools
id: setup
continue-on-error: true
run: |
wget -q -O - https://files.pvs-studio.com/etc/pubkey.txt \
| sudo gpg --no-default-keyring --keyring gnupg-ring:/etc/apt/trusted.gpg.d/PVS.gpg --import
sudo apt-key adv --refresh-keys
sudo chmod 644 /etc/apt/trusted.gpg.d/PVS.gpg
sudo wget -O /etc/apt/sources.list.d/viva64.list \
https://files.pvs-studio.com/etc/viva64.list
sudo apt update
sudo apt install pvs-studio
pvs-studio-analyzer credentials ${{ secrets.PVS_STUDIO_CREDENTIALS }}
- name: Run CMake
if: steps.setup.outcome == 'success' && steps.setup.conclusion == 'success'
uses: lukka/run-cmake@v10
with:
configurePreset: ci-ubuntu-clang-tests-no-checks
buildPreset: ci-build
- name: Analyze and prepare report
if: steps.setup.outcome == 'success' && steps.setup.conclusion == 'success'
run: |
pvs-studio-analyzer analyze -f build/compile_commands.json -j -e build/_deps/
plog-converter -t sarif -o pvs-report.sarif PVS-Studio.log
- name: Publish report
if: steps.setup.outcome == 'success' && steps.setup.conclusion == 'success'
uses: github/codeql-action/upload-sarif@v3
with:
sarif_file: pvs-report.sarif
category: PVS-Studio
sonarcloud_and_coverage:
runs-on: ubuntu-latest
if: github.repository_owner == 'victimsnino' && github.event.workflow_run.conclusion == 'success'
env:
BUILD_WRAPPER_OUT_DIR: build_wrapper_output_directory # Directory where build-wrapper output will be placed
steps:
- uses: haya14busa/action-workflow_run-status@main
- uses: actions/checkout@v4
with:
token: ${{ secrets.GITHUB_TOKEN }}
fetch-depth: 0
repository: ${{ github.event.workflow_run.head_repository.full_name }}
ref: ${{ github.event.workflow_run.head_branch }}
# Work around https://github.com/actions/runner-images/issues/8659
# - name: "Remove GCC 13 from runner image (workaround)"
# shell: bash
# run: |
# sudo apt-get update
# sudo apt-get purge -y g++-13 gcc-13 libstdc++-13-dev
# sudo apt-get install -y --allow-downgrades libstdc++-12-dev libstdc++6=12.* libgcc-s1=12.*
- name: Install llvm
run: sudo apt-get update -q && sudo apt-get install llvm -q -y
- name: Install Qt
uses: jurplel/install-qt-action@v4
with:
cache: true
- name: get conan
uses: turtlebrowser/get-conan@main
- name: cache deps
uses: actions/cache@v4
with:
path: |
~/.conan2
/Users/runner/.conan2/
key: deps-ci-ubuntu-clang-Release-${{ hashFiles('**/conanfile.py') }}
restore-keys: deps-ci-ubuntu-clang-Release
- name: conan detect profile
run: |
conan profile detect --force
- name: Install sonar-scanner and build-wrapper
uses: sonarsource/sonarcloud-github-c-cpp@v3
- name: Run build-wrapper
run: |
mkdir build
cmake --preset=ci-coverage-clang
build-wrapper-linux-x86-64 --out-dir ${{ env.BUILD_WRAPPER_OUT_DIR }} cmake --build --preset=ci-build
ctest --preset=ci-tests
- name: Process coverage info
run: cmake --build build -t coverage
- name: "Get PR information"
uses: potiuk/get-workflow-origin@v1_3
id: source-run-info
with:
token: ${{ secrets.GITHUB_TOKEN }}
sourceRunId: ${{ github.event.workflow_run.id }}
- name: Submit to codecov.io
uses: codecov/codecov-action@v4
with:
file: build/test_results/coverage.txt
override_branch: ${{ github.event.workflow_run.head_branch }}
override_pr: ${{ steps.source-run-info.outputs.pullRequestNumber }}
override_commit: ${{ github.event.workflow_run.head_sha }}
- name: Run sonar-scanner on PUSH
if: github.event.workflow_run.event == 'push'
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
run: |
sonar-scanner --define sonar.cfamily.build-wrapper-output="${{ env.BUILD_WRAPPER_OUT_DIR }}" --define sonar.scm.revision=${{ github.event.workflow_run.head_sha }}
- name: Run sonar-scanner on PullRequest
if: github.event.workflow_run.event == 'pull_request'
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
run: |
sonar-scanner --define sonar.cfamily.build-wrapper-output="${{ env.BUILD_WRAPPER_OUT_DIR }}" --define sonar.scm.revision=${{ github.event.workflow_run.head_sha }} --define sonar.pullrequest.key=${{ steps.source-run-info.outputs.pullRequestNumber }} --define sonar.pullrequest.branch=${{ steps.source-run-info.outputs.sourceHeadBranch }} --define sonar.pullrequest.base=${{ steps.source-run-info.outputs.targetBranch }}