mirror of
https://github.com/hathach/tinyusb.git
synced 2026-02-15 01:35:37 +00:00
iar cstat require cmake at least 4.1
This commit is contained in:
19
.github/workflows/static_analysis.yml
vendored
19
.github/workflows/static_analysis.yml
vendored
@ -202,23 +202,34 @@ jobs:
|
||||
with:
|
||||
toolchain: 'arm-iar'
|
||||
|
||||
- name: Run IAR C-STAT Analysis
|
||||
- name: Install CMake 4.2
|
||||
run: |
|
||||
# IAR CSTAT requires CMake >= 4.1
|
||||
wget -q https://github.com/Kitware/CMake/releases/download/v4.2.0-rc1/cmake-4.2.0-rc1-linux-x86_64.tar.gz
|
||||
tar -xzf cmake-4.2.0-rc1-linux-x86_64.tar.gz
|
||||
echo "${{ github.workspace }}/cmake-4.2.0-rc1-linux-x86_64/bin" >> $GITHUB_PATH
|
||||
|
||||
- name: Build and run IAR C-STAT Analysis
|
||||
env:
|
||||
IAR_LMS_BEARER_TOKEN: ${{ secrets.IAR_LMS_BEARER_TOKEN }}
|
||||
run: |
|
||||
# CMake run post build to generate C-STAT SARIF report
|
||||
cmake --version
|
||||
mkdir -p build
|
||||
cmake examples -B build -G Ninja -DBOARD=${{ matrix.board }} -DTOOLCHAIN=iar -DIAR_CSTAT=1 -DCMAKE_BUILD_TYPE=MinSizeRel
|
||||
cmake examples/device/cdc_msc -B build -G Ninja -DBOARD=${{ matrix.board }} -DTOOLCHAIN=iar -DIAR_CSTAT=1 -DCMAKE_BUILD_TYPE=MinSizeRel
|
||||
cmake --build build
|
||||
# Merge sarif files for codeql upload
|
||||
npm i -g @microsoft/sarif-multitool
|
||||
npx @microsoft/sarif-multitool merge --merge-runs --output-file iar-cstat-${{ matrix.board }}.sarif build/cstat_sarif/*.sarif
|
||||
|
||||
- name: Upload SARIF
|
||||
uses: github/codeql-action/upload-sarif@v4
|
||||
with:
|
||||
sarif_file: build/cstat_sarif
|
||||
sarif_file: iar-cstat-${{ matrix.board }}.sarif
|
||||
category: IAR-CStat
|
||||
|
||||
- name: Upload artifact
|
||||
uses: actions/upload-artifact@v5
|
||||
with:
|
||||
name: iar-cstat-${{ matrix.board }}
|
||||
path: build/cstat_sarif
|
||||
path: iar-cstat-${{ matrix.board }}.sarif
|
||||
|
||||
@ -19,6 +19,7 @@ find_program(CMAKE_IAR_CHECKS ichecks)
|
||||
find_program(CMAKE_IAR_REPORT ireport)
|
||||
|
||||
if (IAR_CSTAT)
|
||||
cmake_minimum_required(VERSION 4.1)
|
||||
set(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)
|
||||
endif ()
|
||||
|
||||
|
||||
@ -300,10 +300,10 @@ function(family_configure_common TARGET RTOS)
|
||||
COMMAND_EXPAND_LISTS
|
||||
)
|
||||
# generate C-STAT report
|
||||
add_custom_command(TARGET ${TARGET} POST_BUILD
|
||||
COMMAND mkdir -p ${CMAKE_CURRENT_BINARY_DIR}/cstat_report
|
||||
COMMAND ireport --db=${CMAKE_BINARY_DIR}/cstat.db --full --project ${TARGET} --output ${CMAKE_CURRENT_BINARY_DIR}/cstat_report/index.html
|
||||
)
|
||||
# add_custom_command(TARGET ${TARGET} POST_BUILD
|
||||
# COMMAND mkdir -p ${CMAKE_CURRENT_BINARY_DIR}/cstat_report
|
||||
# COMMAND ireport --db=${CMAKE_BINARY_DIR}/cstat.db --full --project ${TARGET} --output ${CMAKE_CURRENT_BINARY_DIR}/cstat_report/index.html
|
||||
# )
|
||||
endif ()
|
||||
endif ()
|
||||
|
||||
|
||||
Reference in New Issue
Block a user