File tree Expand file tree Collapse file tree 3 files changed +20
-8
lines changed
examples/build_system/cmake/toolchain Expand file tree Collapse file tree 3 files changed +20
-8
lines changed Original file line number Diff line number Diff line change @@ -202,23 +202,34 @@ jobs:
202202 with :
203203 toolchain : ' arm-iar'
204204
205- - name : Run IAR C-STAT Analysis
205+ - name : Install CMake 4.2
206+ run : |
207+ # IAR CSTAT requires CMake >= 4.1
208+ wget -q https://github.com/Kitware/CMake/releases/download/v4.2.0-rc1/cmake-4.2.0-rc1-linux-x86_64.tar.gz
209+ tar -xzf cmake-4.2.0-rc1-linux-x86_64.tar.gz
210+ echo "${{ github.workspace }}/cmake-4.2.0-rc1-linux-x86_64/bin" >> $GITHUB_PATH
211+
212+ - name : Build and run IAR C-STAT Analysis
206213 env :
207214 IAR_LMS_BEARER_TOKEN : ${{ secrets.IAR_LMS_BEARER_TOKEN }}
208215 run : |
209216 # CMake run post build to generate C-STAT SARIF report
217+ cmake --version
210218 mkdir -p build
211- cmake examples -B build -G Ninja -DBOARD=${{ matrix.board }} -DTOOLCHAIN=iar -DIAR_CSTAT=1 -DCMAKE_BUILD_TYPE=MinSizeRel
219+ cmake examples/device/cdc_msc -B build -G Ninja -DBOARD=${{ matrix.board }} -DTOOLCHAIN=iar -DIAR_CSTAT=1 -DCMAKE_BUILD_TYPE=MinSizeRel
212220 cmake --build build
221+ # Merge sarif files for codeql upload
222+ npm i -g @microsoft/sarif-multitool
223+ npx @microsoft/sarif-multitool merge --merge-runs --output-file iar-cstat-${{ matrix.board }}.sarif build/cstat_sarif/*.sarif
213224
214225 - name : Upload SARIF
215226 uses : github/codeql-action/upload-sarif@v4
216227 with :
217- sarif_file : build/cstat_sarif
228+ sarif_file : iar-cstat-${{ matrix.board }}.sarif
218229 category : IAR-CStat
219230
220231 - name : Upload artifact
221232 uses : actions/upload-artifact@v5
222233 with :
223234 name : iar-cstat-${{ matrix.board }}
224- path : build/cstat_sarif
235+ path : iar-cstat-${{ matrix.board }}.sarif
Original file line number Diff line number Diff line change @@ -19,6 +19,7 @@ find_program(CMAKE_IAR_CHECKS ichecks)
1919find_program (CMAKE_IAR_REPORT ireport)
2020
2121if (IAR_CSTAT)
22+ cmake_minimum_required (VERSION 4.1)
2223set (CMAKE_C_ICSTAT ${CMAKE_IAR_CSTAT} --checks=${CMAKE_CURRENT_LIST_DIR} /cstat_sel_checks.txt --db=${CMAKE_BINARY_DIR} /cstat.db --sarif_dir=${CMAKE_BINARY_DIR} /cstat_sarif)
2324endif ()
2425
Original file line number Diff line number Diff line change @@ -300,10 +300,10 @@ function(family_configure_common TARGET RTOS)
300300 COMMAND_EXPAND_LISTS
301301 )
302302 # generate C-STAT report
303- add_custom_command (TARGET ${TARGET} POST_BUILD
304- COMMAND mkdir -p ${CMAKE_CURRENT_BINARY_DIR} /cstat_report
305- COMMAND ireport --db=${CMAKE_BINARY_DIR} /cstat.db --full --project ${TARGET} --output ${CMAKE_CURRENT_BINARY_DIR} /cstat_report/index.html
306- )
303+ # add_custom_command(TARGET ${TARGET} POST_BUILD
304+ # COMMAND mkdir -p ${CMAKE_CURRENT_BINARY_DIR}/cstat_report
305+ # COMMAND ireport --db=${CMAKE_BINARY_DIR}/cstat.db --full --project ${TARGET} --output ${CMAKE_CURRENT_BINARY_DIR}/cstat_report/index.html
306+ # )
307307 endif ()
308308 endif ()
309309
You can’t perform that action at this time.
0 commit comments