Repository navigation
64 lines (55 loc) · 1.61 KB
/
Copy pathcode-analysis.yml
File metadata and controls
64 lines (55 loc) · 1.61 KB
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
name: code-analysis
permissions:
contents: read
security-events: write
on:
push:
paths:
[
'.github/workflows/code-analysis.yml',
'Magpie.slnx',
'*.props',
'scripts/code-analysis.py',
'src/**',
]
pull_request:
paths:
[
'.github/workflows/code-analysis.yml',
'Magpie.slnx',
'*.props',
'scripts/code-analysis.py',
'src/**',
]
workflow_dispatch:
jobs:
code-analysis:
runs-on: windows-2025-vs2026
strategy:
matrix:
tool: ['Microsoft C++ Code Analysis', 'clang-tidy']
steps:
- uses: actions/checkout@v7
- uses: actions/setup-python@v7
with:
python-version: '3.14'
- name: Setup Conan
run: pip install conan
- name: Load Conan cache
uses: actions/cache@v6
with:
path: ~/.conan2/p
key: Conan-${{ hashFiles('src/**/conanfile.txt') }}-${{ case(matrix.tool == 'clang-tidy', 'ClangCL', 'MSVC') }}-x64
- name: Run code analysis
run: python scripts/code-analysis.py --tool="${{ matrix.tool }}"
- name: Upload SARIF as an Artifact
uses: actions/upload-artifact@v7
with:
name: ${{ matrix.tool }}
path: ./code-analysis/${{ case(matrix.tool == 'clang-tidy', 'clang-tidy', 'PREfast') }}.sarif
archive: false
- name: Upload SARIF to GitHub
uses: github/codeql-action/upload-sarif@v4
with:
sarif_file: ./code-analysis/${{ case(matrix.tool == 'clang-tidy', 'clang-tidy', 'PREfast') }}.sarif
category: ${{ matrix.tool }}