From d6bf25df6707177af9bf524b861b5d6df00eb71c Mon Sep 17 00:00:00 2001 From: Nikolaj Schlej Date: Fri, 2 Sep 2022 22:52:16 +0200 Subject: [PATCH] Add CodeQL, build everything for PVS-Studio --- .github/workflows/main.yml | 26 +++++++++++++++++--------- CMakeLists.txt | 7 +++++++ UEFITool/CMakeLists.txt | 2 +- 3 files changed, 25 insertions(+), 10 deletions(-) create mode 100644 CMakeLists.txt diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 28a6aa1..2a40dcf 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -216,9 +216,9 @@ jobs: COVERITY_SCAN_EMAIL: ${{ secrets.COVERITY_SCAN_EMAIL }} COVERITY_BUILD_COMMAND: ./unixbuild.sh --build - analyze_pvs_studio: + analyze_pvs_studio_and_codeql: if: github.repository_owner == 'LongSoft' && github.event_name != 'pull_request' - name: PVS-Studio Static Analysis + name: PVS-Studio and CodeQL Static Analysis runs-on: ubuntu-latest steps: - name: Install Qt @@ -240,21 +240,29 @@ jobs: sudo apt update sudo apt install pvs-studio pvs-studio-analyzer credentials ${{ secrets.PVS_STUDIO_CREDENTIALS }} - - - name: Build + + - name: Initialize CodeQL + uses: github/codeql-action/init@v2 + with: + languages: cpp + + - name: Build everything using CMake run: | - cmake -DCMAKE_EXPORT_COMPILE_COMMANDS=On -B build UEFITool + cmake -DCMAKE_EXPORT_COMPILE_COMMANDS=On -B build . cmake --build build -j - - - name: Analyze + + - name: Perform CodeQL analysis + uses: github/codeql-action/analyze@v2 + + - name: Perform PVS-Studio analysis run: | pvs-studio-analyzer analyze -f build/compile_commands.json -j - - name: Convert report + - name: Convert PVS-Studio report run: | plog-converter -t sarif -o pvs-report.sarif PVS-Studio.log - - name: Publish report + - name: Publish PVS-Studio report uses: github/codeql-action/upload-sarif@v2 with: sarif_file: pvs-report.sarif diff --git a/CMakeLists.txt b/CMakeLists.txt new file mode 100644 index 0000000..71e7a1c --- /dev/null +++ b/CMakeLists.txt @@ -0,0 +1,7 @@ +CMAKE_MINIMUM_REQUIRED(VERSION 3.16) + +PROJECT(UEFITool_everything) + +ADD_SUBDIRECTORY(UEFIExtract) +ADD_SUBDIRECTORY(UEFIFind) +ADD_SUBDIRECTORY(UEFITool) diff --git a/UEFITool/CMakeLists.txt b/UEFITool/CMakeLists.txt index 3f5f068..cfab613 100644 --- a/UEFITool/CMakeLists.txt +++ b/UEFITool/CMakeLists.txt @@ -148,5 +148,5 @@ TARGET_LINK_LIBRARIES(UEFITool PRIVATE Qt6::Widgets) SET_TARGET_PROPERTIES(UEFITool PROPERTIES WIN32_EXECUTABLE ON MACOSX_BUNDLE ON - MACOSX_BUNDLE_INFO_PLIST "${CMAKE_SOURCE_DIR}/Info.plist" + MACOSX_BUNDLE_INFO_PLIST "${CMAKE_CURRENT_SOURCE_DIR}/Info.plist" )