mirror of
https://github.com/LongSoft/UEFITool.git
synced 2024-11-25 09:28:22 +08:00
Run PVS-Studio static analyzer as part of CI/CD
This commit is contained in:
parent
3977fcaed9
commit
787e02181a
48
.github/workflows/main.yml
vendored
48
.github/workflows/main.yml
vendored
@ -192,13 +192,13 @@ jobs:
|
|||||||
JOB_TYPE: COVERITY
|
JOB_TYPE: COVERITY
|
||||||
HAS_QT: 1
|
HAS_QT: 1
|
||||||
if: github.repository_owner == 'LongSoft' && github.event_name != 'pull_request'
|
if: github.repository_owner == 'LongSoft' && github.event_name != 'pull_request'
|
||||||
name: Coverity
|
name: Coverity Static Analysis
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- name: Install Qt
|
- name: Install Qt
|
||||||
uses: jurplel/install-qt-action@v3
|
uses: jurplel/install-qt-action@v3
|
||||||
with:
|
with:
|
||||||
version: '6.2.4'
|
version: '6.3.1'
|
||||||
host: 'linux'
|
host: 'linux'
|
||||||
target: 'desktop'
|
target: 'desktop'
|
||||||
|
|
||||||
@ -215,3 +215,47 @@ jobs:
|
|||||||
COVERITY_SCAN_TOKEN: ${{ secrets.COVERITY_SCAN_TOKEN }}
|
COVERITY_SCAN_TOKEN: ${{ secrets.COVERITY_SCAN_TOKEN }}
|
||||||
COVERITY_SCAN_EMAIL: ${{ secrets.COVERITY_SCAN_EMAIL }}
|
COVERITY_SCAN_EMAIL: ${{ secrets.COVERITY_SCAN_EMAIL }}
|
||||||
COVERITY_BUILD_COMMAND: ./unixbuild.sh --build
|
COVERITY_BUILD_COMMAND: ./unixbuild.sh --build
|
||||||
|
|
||||||
|
analyze_pvs_studio:
|
||||||
|
if: github.repository_owner == 'LongSoft' && github.event_name != 'pull_request'
|
||||||
|
name: PVS-Studio Static Analysis
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- name: Install Qt
|
||||||
|
uses: jurplel/install-qt-action@v3
|
||||||
|
with:
|
||||||
|
version: '6.3.1'
|
||||||
|
host: 'linux'
|
||||||
|
target: 'desktop'
|
||||||
|
|
||||||
|
- name: Check out
|
||||||
|
uses: actions/checkout@v2
|
||||||
|
|
||||||
|
- name: Install PVS-Studio
|
||||||
|
run: |
|
||||||
|
wget -q -O - https://files.pvs-studio.com/etc/pubkey.txt \
|
||||||
|
| sudo apt-key add -
|
||||||
|
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: Build
|
||||||
|
run: |
|
||||||
|
cmake -DCMAKE_EXPORT_COMPILE_COMMANDS=On -B build UEFITool
|
||||||
|
cmake --build build -j
|
||||||
|
|
||||||
|
- name: Analyze
|
||||||
|
run: |
|
||||||
|
pvs-studio-analyzer analyze -f build/compile_commands.json -j
|
||||||
|
|
||||||
|
- name: Convert report
|
||||||
|
run: |
|
||||||
|
plog-converter -t sarif -o pvs-report.sarif PVS-Studio.log
|
||||||
|
|
||||||
|
- name: Publish report
|
||||||
|
uses: github/codeql-action/upload-sarif@v2
|
||||||
|
with:
|
||||||
|
sarif_file: pvs-report.sarif
|
||||||
|
category: PVS-Studio
|
@ -139,7 +139,7 @@ ADD_DEFINITIONS(
|
|||||||
|
|
||||||
SET_SOURCE_FILES_PROPERTIES(icons/uefitool.icns PROPERTIES MACOSX_PACKAGE_LOCATION "Resources")
|
SET_SOURCE_FILES_PROPERTIES(icons/uefitool.icns PROPERTIES MACOSX_PACKAGE_LOCATION "Resources")
|
||||||
|
|
||||||
ADD_EXECUTABLE(UEFITool ${PROJECT_HEADERS} ${PROJECT_FORMS} ${PROJECT_SOURCES})
|
ADD_EXECUTABLE(UEFITool ${PROJECT_HEADERS} ${PROJECT_FORMS} ${PROJECT_SOURCES})
|
||||||
|
|
||||||
TARGET_INCLUDE_DIRECTORIES(UEFITool PRIVATE "${CMAKE_CURRENT_SOURCE_DIR}")
|
TARGET_INCLUDE_DIRECTORIES(UEFITool PRIVATE "${CMAKE_CURRENT_SOURCE_DIR}")
|
||||||
|
|
||||||
@ -148,4 +148,5 @@ TARGET_LINK_LIBRARIES(UEFITool PRIVATE Qt6::Widgets)
|
|||||||
SET_TARGET_PROPERTIES(UEFITool PROPERTIES
|
SET_TARGET_PROPERTIES(UEFITool PROPERTIES
|
||||||
WIN32_EXECUTABLE ON
|
WIN32_EXECUTABLE ON
|
||||||
MACOSX_BUNDLE ON
|
MACOSX_BUNDLE ON
|
||||||
MACOSX_BUNDLE_INFO_PLIST "${CMAKE_SOURCE_DIR}/Info.plist")
|
MACOSX_BUNDLE_INFO_PLIST "${CMAKE_SOURCE_DIR}/Info.plist"
|
||||||
|
)
|
||||||
|
Loading…
Reference in New Issue
Block a user