@@ -2,15 +2,30 @@ name: Static Analysis
22on :
33 workflow_dispatch :
44 push :
5- branches :
6- - master
5+ branches : [ master ]
6+ paths :
7+ - ' src/**'
8+ - ' examples/**'
9+ - ' hw/bsp/**'
10+ - ' .github/workflows/static_analysis.yml'
711 pull_request :
8- types : [opened, synchronize, reopened]
12+ branches : [ master ]
13+ paths :
14+ - ' src/**'
15+ - ' examples/**'
16+ - ' hw/bsp/**'
17+ - ' .github/workflows/static_analysis.yml'
918
1019permissions :
1120 actions : read
1221 contents : read
1322 security-events : write
23+ # pull-requests: write
24+ # checks: write
25+
26+ concurrency :
27+ group : ${{ github.workflow }}-${{ github.ref }}
28+ cancel-in-progress : true
1429
1530jobs :
1631 CodeQL :
@@ -50,36 +65,23 @@ jobs:
5065 uses : github/codeql-action/analyze@v4
5166 with :
5267 category : CodeQL
53- upload : always
68+ upload : false
5469 id : analyze
5570
56- # - name: Filter out unwanted errors and warnings
57- # uses: advanced-security/filter-sarif@v1
58- # with:
59- # patterns: |
60- # -**:cpp/path-injection
61- # -**:cpp/world-writable-file-creation
62- # -**:cpp/poorly-documented-function
63- # -**:cpp/potentially-dangerous-function
64- # -**:cpp/use-of-goto
65- # -**:cpp/integer-multiplication-cast-to-long
66- # -**:cpp/comparison-with-wider-type
67- # -**:cpp/leap-year/*
68- # -**:cpp/ambiguously-signed-bit-field
69- # -**:cpp/suspicious-pointer-scaling
70- # -**:cpp/suspicious-pointer-scaling-void
71- # -**:cpp/unsigned-comparison-zero
72- # -**/third*party/**
73- # -**/3rd*party/**
74- # -**/external/**
75- # input: ${{ steps.analyze.outputs.sarif-output }}/cpp.sarif
76- # output: ${{ steps.analyze.outputs.sarif-output }}/cpp.sarif
77- #
78- # - name: Upload SARIF
79- # uses: github/codeql-action/upload-sarif@v4
80- # with:
81- # sarif_file: ${{ steps.analyze.outputs.sarif-output }}
82- # category: CodeQL
71+ - name : Filter SARIF report
72+ uses : advanced-security/filter-sarif@v1
73+ with :
74+ patterns : |
75+ -hw/mcu/**
76+ -lib/**
77+ input : ${{ steps.analyze.outputs.sarif-output }}/cpp.sarif
78+ output : ${{ steps.analyze.outputs.sarif-output }}/cpp.sarif
79+
80+ - name : Upload SARIF
81+ uses : github/codeql-action/upload-sarif@v4
82+ with :
83+ sarif_file : ${{ steps.analyze.outputs.sarif-output }}
84+ category : CodeQL
8385
8486 - name : Upload artifact
8587 uses : actions/upload-artifact@v5
@@ -122,7 +124,7 @@ jobs:
122124 mkdir -p build
123125 cmake examples -B build -G Ninja -DBOARD=${{ matrix.board }} -DCMAKE_BUILD_TYPE=MinSizeRel
124126 cmake --build build
125- pvs-studio-analyzer analyze -f build/compile_commands.json -j -- exclude-path hw/mcu/ --exclude-path lib/
127+ pvs-studio-analyzer analyze -R .PVS-Studio/.pvsconfig - f build/compile_commands.json -- exclude-path hw/mcu/ --exclude-path lib/ -j
126128 plog-converter -t sarif -o pvs-studio-${{ matrix.board }}.sarif PVS-Studio.log
127129
128130 - name : Upload SARIF
0 commit comments