From 96bdb9db84bd57aeb9af69ecdfb2a79af6e61aa4 Mon Sep 17 00:00:00 2001 From: dpasukhi Date: Sat, 19 Oct 2024 15:07:38 +0100 Subject: [PATCH 1/6] Tests - Action to build Refman doc #103 Add GitHub Actions workflow for building OCCT refman documentation --- .github/workflows/build-doc-refman.yml | 36 ++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) create mode 100644 .github/workflows/build-doc-refman.yml diff --git a/.github/workflows/build-doc-refman.yml b/.github/workflows/build-doc-refman.yml new file mode 100644 index 0000000000..8992cbf8f4 --- /dev/null +++ b/.github/workflows/build-doc-refman.yml @@ -0,0 +1,36 @@ +# This workflow will build OCCT refman documentation. + +name: Build Refman Documentation + +on: + push: + branches: + - 'master' + +jobs: + build: + runs-on: ubuntu-latest + + steps: + - name: Checkout repository + uses: actions/checkout@v4.2.1 + + - name: Install dependencies + run: sudo apt-get update && sudo apt-get install -y tcl-dev tk-dev cmake gcc g++ make libbtbb-dev libx11-dev libglu1-mesa-dev doxygen graphviz + + - name: Build documentation + run: bash gendoc -refman + + - name: Upload refman documentation + uses: actions/upload-artifact@v4.4.3 + id: artifact-upload-step + with: + name: refman-doc + path: doc/refman + retention-days: 90 + + - name: Upload generation log + uses: actions/upload-artifact@v4.4.3 + with: + name: dogygen.log + path: doc/html_doxygen_err.log From 3cdf8e79f984089f9fa4b116a24bdd2908af88ab Mon Sep 17 00:00:00 2001 From: dpasukhi Date: Sat, 19 Oct 2024 17:02:13 +0100 Subject: [PATCH 2/6] Configuration - JeMalloc from default package #105 Fixed issue with jemalloc from ubuntu, debian and etc default packages --- adm/cmake/jemalloc.cmake | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/adm/cmake/jemalloc.cmake b/adm/cmake/jemalloc.cmake index c6a90c46bd..579ed3e150 100644 --- a/adm/cmake/jemalloc.cmake +++ b/adm/cmake/jemalloc.cmake @@ -125,10 +125,15 @@ if (NOT 3RDPARTY_JEMALLOC_INCLUDE_DIR OR NOT EXISTS "${3RDPARTY_JEMALLOC_INCLUDE if (3RDPARTY_JEMALLOC_DIR AND EXISTS "${3RDPARTY_JEMALLOC_DIR}") find_path (3RDPARTY_JEMALLOC_INCLUDE_DIR NAMES ${HEADER_NAMES} - PATHS ${3RDPARTY_JEMALLOC_DIR} - PATH_SUFFIXES include/jemalloc - CMAKE_FIND_ROOT_PATH_BOTH - NO_DEFAULT_PATH) + PATHS ${3RDPARTY_JEMALLOC_DIR} + PATH_SUFFIXES include/jemalloc + CMAKE_FIND_ROOT_PATH_BOTH + NO_DEFAULT_PATH) + else() + find_path (3RDPARTY_JEMALLOC_INCLUDE_DIR NAMES ${HEADER_NAMES} + PATHS ${3RDPARTY_JEMALLOC_DIR} + PATH_SUFFIXES include/jemalloc + CMAKE_FIND_ROOT_PATH_BOTH) endif() endif() From a97a8e66e380475bd0fc2c2ae3b4a8311ed7eba1 Mon Sep 17 00:00:00 2001 From: dpasukhi Date: Sat, 19 Oct 2024 17:04:53 +0100 Subject: [PATCH 3/6] Configuration - Production build type for linux #106 Fixed problem with not relevant flags and missed C language flags. --- adm/cmake/occt_defs_flags.cmake | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/adm/cmake/occt_defs_flags.cmake b/adm/cmake/occt_defs_flags.cmake index 0d8fe91fb3..6271a35043 100644 --- a/adm/cmake/occt_defs_flags.cmake +++ b/adm/cmake/occt_defs_flags.cmake @@ -147,14 +147,14 @@ elseif (CMAKE_COMPILER_IS_GNUCC OR CMAKE_COMPILER_IS_GNUCXX OR (CMAKE_CXX_COMPIL # /GL (whole program optimization) is similar to -flto (Link Time Optimization) in GCC/Clang. # /GF (eliminate duplicate strings) doesn't have a direct equivalent in GCC/Clang, but the compilers do string pooling automatically. # /Gy (enable function-level linking) is similar to -ffunction-sections in GCC/Clang. - # /fp:precise (improve floating-point consistency) is similar to -ffloat-store in GCC, but there isn't a perfect equivalent in Clang. - set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -O3 -fomit-frame-pointer -flto -ffunction-sections -ffloat-store") + set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -O3 -fomit-frame-pointer -flto -ffunction-sections") + set(CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE} -O3 -fomit-frame-pointer -flto -ffunction-sections") # Link-Time Code Generation(LTCG) is requared for Whole Program Optimisation(GL) - set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -flto") - set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -flto") - set(CMAKE_STATIC_LINKER_FLAGS "${CMAKE_STATIC_LINKER_FLAGS} -flto") - set(CMAKE_MODULE_LINKER_FLAGS "${CMAKE_MODULE_LINKER_FLAGS} -flto") + set(CMAKE_EXE_LINKER_FLAGS_RELEASE "${CMAKE_EXE_LINKER_FLAGS_RELEASE} -flto") + set(CMAKE_SHARED_LINKER_FLAGS_RELEASE "${CMAKE_SHARED_LINKER_FLAGS_RELEASE} -flto") + set(CMAKE_STATIC_LINKER_FLAGS_RELEASE "${CMAKE_STATIC_LINKER_FLAGS_RELEASE} -flto") + set(CMAKE_MODULE_LINKER_FLAGS_RELEASE "${CMAKE_MODULE_LINKER_FLAGS_RELEASE} -flto") endif() if (CMAKE_CXX_COMPILER_ID MATCHES "[Cc][Ll][Aa][Nn][Gg]") set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wshorten-64-to-32") From 191fc37915b1f3b68be86cc51b7a5c0aa7d677e9 Mon Sep 17 00:00:00 2001 From: dpasukhi Date: Sun, 20 Oct 2024 14:58:41 +0100 Subject: [PATCH 4/6] Coding - OpenVR module compilation fail #107 Compilation failed with Clang on OpenVR module --- src/Aspect/Aspect_OpenVRSession.cxx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Aspect/Aspect_OpenVRSession.cxx b/src/Aspect/Aspect_OpenVRSession.cxx index d04f729ea0..2c295435f6 100644 --- a/src/Aspect/Aspect_OpenVRSession.cxx +++ b/src/Aspect/Aspect_OpenVRSession.cxx @@ -168,7 +168,7 @@ struct Aspect_OpenVRSession::VRContext vr::IVRSystem* System; //!< OpenVR session object //! Empty constructor. - Aspect_OpenVRSession::VRContext() : System (NULL) + VRContext() : System (NULL) { memset (TrackedPoses, 0, sizeof(TrackedPoses)); } From 674c246128e586fd09707f92c622862eff29ce75 Mon Sep 17 00:00:00 2001 From: dpasukhi Date: Sun, 20 Oct 2024 15:03:00 +0100 Subject: [PATCH 5/6] Configuration - Update optimization flags for release build #108 --- adm/cmake/occt_defs_flags.cmake | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/adm/cmake/occt_defs_flags.cmake b/adm/cmake/occt_defs_flags.cmake index 6271a35043..974f9784dd 100644 --- a/adm/cmake/occt_defs_flags.cmake +++ b/adm/cmake/occt_defs_flags.cmake @@ -147,14 +147,14 @@ elseif (CMAKE_COMPILER_IS_GNUCC OR CMAKE_COMPILER_IS_GNUCXX OR (CMAKE_CXX_COMPIL # /GL (whole program optimization) is similar to -flto (Link Time Optimization) in GCC/Clang. # /GF (eliminate duplicate strings) doesn't have a direct equivalent in GCC/Clang, but the compilers do string pooling automatically. # /Gy (enable function-level linking) is similar to -ffunction-sections in GCC/Clang. - set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -O3 -fomit-frame-pointer -flto -ffunction-sections") - set(CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE} -O3 -fomit-frame-pointer -flto -ffunction-sections") + set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -O2 -fomit-frame-pointer -flto -ffunction-sections") + set(CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE} -O2 -fomit-frame-pointer -flto -ffunction-sections") # Link-Time Code Generation(LTCG) is requared for Whole Program Optimisation(GL) set(CMAKE_EXE_LINKER_FLAGS_RELEASE "${CMAKE_EXE_LINKER_FLAGS_RELEASE} -flto") - set(CMAKE_SHARED_LINKER_FLAGS_RELEASE "${CMAKE_SHARED_LINKER_FLAGS_RELEASE} -flto") - set(CMAKE_STATIC_LINKER_FLAGS_RELEASE "${CMAKE_STATIC_LINKER_FLAGS_RELEASE} -flto") - set(CMAKE_MODULE_LINKER_FLAGS_RELEASE "${CMAKE_MODULE_LINKER_FLAGS_RELEASE} -flto") + set(CMAKE_SHARED_LINKER_FLAGS_RELEASE "${CMAKE_SHARED_LINKER_FLAGS_RELEASE} -flto -Wl,--gc-sections") + set(CMAKE_STATIC_LINKER_FLAGS_RELEASE "${CMAKE_STATIC_LINKER_FLAGS_RELEASE} -flto -Wl,--gc-sections") + set(CMAKE_MODULE_LINKER_FLAGS_RELEASE "${CMAKE_MODULE_LINKER_FLAGS_RELEASE} -flto -Wl,--gc-sections") endif() if (CMAKE_CXX_COMPILER_ID MATCHES "[Cc][Ll][Aa][Nn][Gg]") set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wshorten-64-to-32") From 857b1b648dd1e7b02cb4b441332f6ac418e9435a Mon Sep 17 00:00:00 2001 From: dpasukhi Date: Sun, 20 Oct 2024 15:08:26 +0100 Subject: [PATCH 6/6] Tests - DRAWEXE Testing integration into GH #109 Introduced a comprehensive multi-platform build and test workflow for OCCT, supporting Windows, macOS, and Linux. Added a new workflow for automated documentation building. Reorganized a code analysis workflow using CodeQL and Microsoft C++ Code Analysis. --- .../build-and-test-multiplatform.yml | 796 ++++++++++++++++++ .github/workflows/build-doc-refman.yml | 36 - .github/workflows/build-docs.yml | 45 + .../build-linux-clang-x64-dynamic.yml | 42 - .../workflows/build-linux-gcc-x64-dynamic.yml | 44 - .../build-macos-clang-x64-dynamic.yml | 45 - .../build-windows-msvc-x64-dynamic.yml | 44 - .github/workflows/code-analysis.yml | 97 +++ .github/workflows/codemsvc.yml | 62 -- .github/workflows/codeql.yml | 60 -- 10 files changed, 938 insertions(+), 333 deletions(-) create mode 100644 .github/workflows/build-and-test-multiplatform.yml delete mode 100644 .github/workflows/build-doc-refman.yml create mode 100644 .github/workflows/build-docs.yml delete mode 100644 .github/workflows/build-linux-clang-x64-dynamic.yml delete mode 100644 .github/workflows/build-linux-gcc-x64-dynamic.yml delete mode 100644 .github/workflows/build-macos-clang-x64-dynamic.yml delete mode 100644 .github/workflows/build-windows-msvc-x64-dynamic.yml create mode 100644 .github/workflows/code-analysis.yml delete mode 100644 .github/workflows/codemsvc.yml delete mode 100644 .github/workflows/codeql.yml diff --git a/.github/workflows/build-and-test-multiplatform.yml b/.github/workflows/build-and-test-multiplatform.yml new file mode 100644 index 0000000000..46945b65a2 --- /dev/null +++ b/.github/workflows/build-and-test-multiplatform.yml @@ -0,0 +1,796 @@ +# This workflow builds and tests OCCT on multiple platforms (Windows, macOS, Linux with Clang, and Linux with GCC). +# It is triggered on pull requests to any branch. +# The workflow includes steps to prepare and build the project on each platform, run tests, and upload the results. +# Concurrency is set to ensure that only one instance of the workflow runs per pull request at a time. + +name: Build and Test OCCT on Multiple Platforms + +on: + pull_request: + branches: + - '**' + +concurrency: + group: ${{ github.workflow }}-${{ github.event.pull_request.number }} + cancel-in-progress: true + +jobs: + prepare-and-build-windows-x64: + name: Prepare and Build on Windows with MSVC (x64) + runs-on: windows-2022 + + steps: + # Step: Checkout the repository + - name: Checkout repository + uses: actions/checkout@v4.1.7 + + # Step: Set up MSVC environment + - name: Set up MSVC + uses: ilammy/msvc-dev-cmd@v1.13.0 + with: + arch: x64 + + # Step: Download and extract 3rdparty dependencies + - name: Download and extract 3rdparty dependencies + run: | + Invoke-WebRequest -Uri https://github.com/Open-Cascade-SAS/OCCT/releases/download/V7_8_0/3rdparty-vc14-64.zip -OutFile 3rdparty-vc14-64.zip + Expand-Archive -Path 3rdparty-vc14-64.zip -DestinationPath . + Remove-Item 3rdparty-vc14-64.zip + shell: pwsh + + # Step: Configure OCCT with CMake + - name: Configure OCCT + run: | + mkdir build + cd build + cmake -T host=x64 ` + -D USE_FREETYPE=ON ` + -D USE_TK=OFF ` + -D BUILD_USE_PCH=ON ` + -D BUILD_OPT_PROFILE=Production ` + -D BUILD_INCLUDE_SYMLINK=ON ` + -D CMAKE_BUILD_TYPE=Release ` + -D 3RDPARTY_DIR=${{ github.workspace }}/3rdparty-vc14-64 ` + -D INSTALL_DIR=${{ github.workspace }}/install ` + -D USE_DRACO=ON ` + -D USE_FFMPEG=ON ` + -D USE_FREEIMAGE=ON ` + -D USE_GLES2=ON ` + -D USE_OPENVR=ON ` + -D USE_VTK=ON ` + -D USE_TBB=ON ` + -D USE_RAPIDJSON=ON ` + -D USE_OPENGL=ON .. + shell: pwsh + + # Step: Build OCCT + - name: Build OCCT + run: | + cd build + cmake --build . --config Release -- /m + + # Step: Install OCCT + - name: Install OCCT + run: | + cd build + cmake --install . --config Release + + # Step: Upload install directory + - name: Upload install directory + uses: actions/upload-artifact@v4.4.3 + with: + name: install-windows-x64 + path: install + + prepare-and-build-windows-clang-x64: + name: Prepare and Build on Windows with Clang (x64) + runs-on: windows-2022 + + steps: + # Step: Checkout the repository + - name: Checkout repository + uses: actions/checkout@v4.1.7 + + # Step: Set up MSVC environment + - name: Set up MSVC + uses: ilammy/msvc-dev-cmd@v1.13.0 + with: + arch: x64 + + # Step: Download and extract 3rdparty dependencies + - name: Download and extract 3rdparty dependencies + run: | + Invoke-WebRequest -Uri https://github.com/Open-Cascade-SAS/OCCT/releases/download/V7_8_0/3rdparty-vc14-64.zip -OutFile 3rdparty-vc14-64.zip + Expand-Archive -Path 3rdparty-vc14-64.zip -DestinationPath . + Remove-Item 3rdparty-vc14-64.zip + shell: pwsh + + # Step: Configure OCCT with CMake + - name: Configure OCCT + run: | + mkdir build + cd build + cmake -G "Ninja" ` + -D CMAKE_C_COMPILER=clang ` + -D CMAKE_CXX_COMPILER=clang++ ` + -D USE_FREETYPE=ON ` + -D USE_TK=OFF ` + -D BUILD_USE_PCH=ON ` + -D BUILD_OPT_PROFILE=Production ` + -D BUILD_INCLUDE_SYMLINK=ON ` + -D CMAKE_BUILD_TYPE=Release ` + -D 3RDPARTY_DIR=${{ github.workspace }}/3rdparty-vc14-64 ` + -D INSTALL_DIR=${{ github.workspace }}/install ` + -D USE_DRACO=ON ` + -D USE_FFMPEG=ON ` + -D USE_FREEIMAGE=ON ` + -D USE_GLES2=OFF ` + -D USE_OPENVR=ON ` + -D USE_VTK=OFF ` + -D USE_TBB=ON ` + -D USE_RAPIDJSON=ON ` + -D USE_OPENGL=ON .. + shell: pwsh + + # Step: Build OCCT + - name: Build OCCT + run: | + cd build + cmake --build . --config Release + + # Step: Install OCCT + - name: Install OCCT + run: | + cd build + cmake --install . --config Release + + # Step: Upload install directory + - name: Upload install directory + uses: actions/upload-artifact@v4.4.3 + with: + name: install-windows-clang-x64 + path: install + + prepare-and-build-macos-x64: + name: Prepare and Build on macOS with Clang (x64) + runs-on: macos-15 + + steps: + # Step: Checkout the repository + - name: Checkout repository + uses: actions/checkout@v4.1.7 + + # Step: Install dependencies using Homebrew + - name: Install dependencies + run: | + brew update + brew install tcl-tk tbb gl2ps xerces-c \ + libxmu libxi libxft libxpm \ + glew + + # Step: Configure OCCT with CMake + - name: Configure OCCT + run: | + mkdir -p build + cd build + cmake -G "Unix Makefiles" \ + -D CMAKE_C_COMPILER=clang \ + -D CMAKE_CXX_COMPILER=clang++ \ + -D USE_FREETYPE=OFF \ + -D BUILD_USE_PCH=ON \ + -D BUILD_INCLUDE_SYMLINK=ON \ + -D CMAKE_BUILD_TYPE=Release \ + -D INSTALL_DIR=${{ github.workspace }}/install .. + + # Step: Build OCCT + - name: Build OCCT + run: | + cd build + make -j$(sysctl -n hw.logicalcpu) + + # Step: Install OCCT + - name: Install OCCT + run: | + cd build + make install + + # Step: Upload install directory + - name: Upload install directory + uses: actions/upload-artifact@v4.4.3 + with: + name: install-macos-x64 + path: install + + prepare-and-build-macos-gcc-x64: + name: Prepare and Build on macOS with GCC (x64) + runs-on: macos-15 + + steps: + # Step: Checkout the repository + - name: Checkout repository + uses: actions/checkout@v4.1.7 + + # Step: Install dependencies using Homebrew + - name: Install dependencies + run: | + brew update + brew install gcc tcl-tk tbb gl2ps xerces-c \ + libxmu libxi libxft libxpm \ + glew + + # Step: Configure OCCT with CMake + - name: Configure OCCT + run: | + mkdir -p build + cd build + cmake -G "Unix Makefiles" \ + -D CMAKE_C_COMPILER=gcc \ + -D CMAKE_CXX_COMPILER=g++ \ + -D USE_FREETYPE=OFF \ + -D BUILD_USE_PCH=ON \ + -D BUILD_INCLUDE_SYMLINK=ON \ + -D CMAKE_BUILD_TYPE=Release \ + -D INSTALL_DIR=${{ github.workspace }}/install .. + + # Step: Build OCCT + - name: Build OCCT + run: | + cd build + make -j$(sysctl -n hw.logicalcpu) + + # Step: Install OCCT + - name: Install OCCT + run: | + cd build + make install + + # Step: Upload install directory + - name: Upload install directory + uses: actions/upload-artifact@v4.4.3 + with: + name: install-macos-gcc-x64 + path: install + + prepare-and-build-linux-clang-x64: + name: Prepare and Build on Ubuntu with Clang (x64) + runs-on: ubuntu-24.04 + + steps: + # Step: Checkout the repository + - name: Checkout repository + uses: actions/checkout@v4.1.7 + + # Step: Install dependencies using apt-get + - name: Install dependencies + run: sudo apt-get update && sudo apt-get install -y tcl-dev tk-dev cmake clang make libbtbb-dev libx11-dev libglu1-mesa-dev tcllib tcl-thread tcl + + # Step: Configure OCCT with CMake + - name: Configure OCCT + run: | + mkdir -p build + cd build + cmake -G "Unix Makefiles" \ + -D CMAKE_C_COMPILER=clang \ + -D CMAKE_CXX_COMPILER=clang++ \ + -D BUILD_USE_PCH=ON \ + -D BUILD_INCLUDE_SYMLINK=ON \ + -D BUILD_OPT_PROFILE=Production \ + -D USE_TK=OFF \ + -D USE_FREETYPE=OFF \ + -D CMAKE_BUILD_TYPE=Release \ + -D INSTALL_DIR=${{ github.workspace }}/install .. + + # Step: Build OCCT + - name: Build OCCT + run: | + cd build + make -j"$(nproc)" + + # Step: Install OCCT + - name: Install OCCT + run: | + cd build + make install + + # Step: Upload install directory + - name: Upload install directory + uses: actions/upload-artifact@v4.4.3 + with: + name: install-linux-clang-x64 + path: install + + prepare-and-build-linux-gcc-x64: + name: Prepare and Build on Ubuntu with GCC (x64) + runs-on: ubuntu-24.04 + + steps: + # Step: Checkout the repository + - name: Checkout repository + uses: actions/checkout@v4.1.7 + + # Step: Install dependencies using apt-get + - name: Install dependencies + run: sudo apt-get update && sudo apt-get install -y tcl-dev tk-dev cmake gcc g++ make libbtbb-dev libx11-dev libglu1-mesa-dev tcllib tcl-thread tcl + + # Step: Configure OCCT with CMake + - name: Configure OCCT + run: | + mkdir -p build + cd build + cmake -G "Unix Makefiles" \ + -D CMAKE_C_COMPILER=gcc \ + -D CMAKE_CXX_COMPILER=g++ \ + -D BUILD_USE_PCH=ON \ + -D BUILD_INCLUDE_SYMLINK=ON \ + -D BUILD_OPT_PROFILE=Production \ + -D USE_TK=OFF \ + -D USE_FREETYPE=OFF \ + -D CMAKE_BUILD_TYPE=Release \ + -D INSTALL_DIR=${{ github.workspace }}/install .. + + # Step: Build OCCT + - name: Build OCCT + run: | + cd build + make -j"$(nproc)" + + # Step: Install OCCT + - name: Install OCCT + run: | + cd build + make install + + # Step: Upload install directory + - name: Upload install directory + uses: actions/upload-artifact@v4.4.3 + with: + name: install-linux-gcc-x64 + path: install + + test-windows-x64: + name: Test on Windows (x64) + runs-on: windows-2022 + needs: prepare-and-build-windows-x64 + + steps: + # Step: Checkout the repository + - name: Checkout repository + uses: actions/checkout@v4.1.7 + + # Step: Set up MSVC environment + - name: Set up MSVC + uses: ilammy/msvc-dev-cmd@v1.13.0 + with: + arch: x64 + + # Step: Download and extract 3rdparty dependencies + - name: Download and extract 3rdparty dependencies + run: | + Invoke-WebRequest -Uri https://github.com/Open-Cascade-SAS/OCCT/releases/download/V7_8_0/3rdparty-vc14-64.zip -OutFile 3rdparty-vc14-64.zip + Expand-Archive -Path 3rdparty-vc14-64.zip -DestinationPath . + Remove-Item 3rdparty-vc14-64.zip + shell: pwsh + + # Step: Download and extract test data + - name: Download and extract test data + run: | + cd data + Invoke-WebRequest -Uri https://github.com/Open-Cascade-SAS/OCCT/releases/download/V7_8_0/opencascade-dataset-7.8.0.zip -OutFile opencascade-dataset-7.8.0.zip + Expand-Archive -Path opencascade-dataset-7.8.0.zip -DestinationPath . + Remove-Item opencascade-dataset-7.8.0.zip + shell: pwsh + + # Step: Download and extract install directory + - name: Download and extract install directory + uses: actions/download-artifact@v4.1.0 + with: + name: install-windows-x64 + path: install + + # Step: Run tests + - name: Run tests + run: | + cd install + call env.bat vc14 win64 release + DRAWEXE.exe -v -c testgrid + shell: cmd + env: + CSF_TestScriptsPath: ${{ github.workspace }}/tests + CSF_TestDataPath: ${{ github.workspace }}/data + + # Step: Upload test results + - name: Upload test results + uses: actions/upload-artifact@v4.4.3 + id: artifact-upload-step + with: + name: results-windows-x64 + path: install/results + retention-days: 7 + + test-windows-clang-x64: + name: Test on Windows with Clang (x64) + runs-on: windows-2022 + needs: prepare-and-build-windows-clang-x64 + + steps: + # Step: Checkout the repository + - name: Checkout repository + uses: actions/checkout@v4.1.7 + + # Step: Set up MSVC environment + - name: Set up MSVC + uses: ilammy/msvc-dev-cmd@v1.13.0 + with: + arch: x64 + + # Step: Download and extract 3rdparty dependencies + - name: Download and extract 3rdparty dependencies + run: | + Invoke-WebRequest -Uri https://github.com/Open-Cascade-SAS/OCCT/releases/download/V7_8_0/3rdparty-vc14-64.zip -OutFile 3rdparty-vc14-64.zip + Expand-Archive -Path 3rdparty-vc14-64.zip -DestinationPath . + Remove-Item 3rdparty-vc14-64.zip + shell: pwsh + + # Step: Download and extract test data + - name: Download and extract test data + run: | + cd data + Invoke-WebRequest -Uri https://github.com/Open-Cascade-SAS/OCCT/releases/download/V7_8_0/opencascade-dataset-7.8.0.zip -OutFile opencascade-dataset-7.8.0.zip + Expand-Archive -Path opencascade-dataset-7.8.0.zip -DestinationPath . + Remove-Item opencascade-dataset-7.8.0.zip + shell: pwsh + + # Step: Download and extract install directory + - name: Download and extract install directory + uses: actions/download-artifact@v4.1.0 + with: + name: install-windows-clang-x64 + path: install + + # Step: Run tests + - name: Run tests + run: | + cd install + call env.bat clang win64 release + DRAWEXE.exe -v -c testgrid + shell: cmd + env: + CSF_TestScriptsPath: ${{ github.workspace }}/tests + CSF_TestDataPath: ${{ github.workspace }}/data + + # Step: Upload test results + - name: Upload test results + uses: actions/upload-artifact@v4.4.3 + id: artifact-upload-step + with: + name: results-windows-clang-x64 + path: install/results + retention-days: 7 + + test-macos-x64: + name: Test on macOS (x64) + runs-on: macos-15 + needs: prepare-and-build-macos-x64 + + steps: + # Step: Checkout the repository + - name: Checkout repository + uses: actions/checkout@v4.1.7 + + # Step: Install dependencies for headless OpenGL + - name: Install dependencies for headless OpenGL + run: | + brew update + brew install mesalib-glw + + # Step: Download test data + - name: Download test data + run: | + cd data + curl -L -O https://github.com/Open-Cascade-SAS/OCCT/releases/download/V7_8_0/opencascade-dataset-7.8.0.tar.xz + tar -xf opencascade-dataset-7.8.0.tar.xz + + # Step: Download and extract install directory + - name: Download and extract install directory + uses: actions/download-artifact@v4.1.0 + with: + name: install-macos-x64 + path: install + + # Step: Set LIBGL_ALWAYS_SOFTWARE environment variable + - name: Set LIBGL_ALWAYS_SOFTWARE environment variable + run: echo "LIBGL_ALWAYS_SOFTWARE=1" >> $GITHUB_ENV + + # Step: Set execute permissions on DRAWEXE + - name: Set execute permissions on DRAWEXE + run: chmod +x install/bin/DRAWEXE + + # Step: Run tests + - name: Run tests + run: | + cd install + cd bin + source env.sh + ./DRAWEXE -v -c testgrid + shell: bash + env: + LIBGL_ALWAYS_SOFTWARE: 1 + CSF_TestScriptsPath: ${{ github.workspace }}/tests + CSF_TestDataPath: ${{ github.workspace }}/data + + # Step: Upload test results + - name: Upload test results + uses: actions/upload-artifact@v4.4.3 + id: artifact-upload-step + with: + name: results-macos-x64 + path: install/bin/results + retention-days: 7 + + test-macos-gcc-x64: + name: Test on macOS with GCC (x64) + runs-on: macos-15 + needs: prepare-and-build-macos-gcc-x64 + + steps: + # Step: Checkout the repository + - name: Checkout repository + uses: actions/checkout@v4.1.7 + + # Step: Install dependencies for headless OpenGL + - name: Install dependencies for headless OpenGL + run: | + brew update + brew install mesalib-glw + + # Step: Download test data + - name: Download test data + run: | + cd data + curl -L -O https://github.com/Open-Cascade-SAS/OCCT/releases/download/V7_8_0/opencascade-dataset-7.8.0.tar.xz + tar -xf opencascade-dataset-7.8.0.tar.xz + + # Step: Download and extract install directory + - name: Download and extract install directory + uses: actions/download-artifact@v4.1.0 + with: + name: install-macos-gcc-x64 + path: install + + # Step: Set LIBGL_ALWAYS_SOFTWARE environment variable + - name: Set LIBGL_ALWAYS_SOFTWARE environment variable + run: echo "LIBGL_ALWAYS_SOFTWARE=1" >> $GITHUB_ENV + + # Step: Set execute permissions on DRAWEXE + - name: Set execute permissions on DRAWEXE + run: chmod +x install/bin/DRAWEXE + + # Step: Run tests + - name: Run tests + run: | + cd install + cd bin + source env.sh + ./DRAWEXE -v -c testgrid + shell: bash + env: + LIBGL_ALWAYS_SOFTWARE: 1 + CSF_TestScriptsPath: ${{ github.workspace }}/tests + CSF_TestDataPath: ${{ github.workspace }}/data + + # Step: Upload test results + - name: Upload test results + uses: actions/upload-artifact@v4.4.3 + id: artifact-upload-step + with: + name: results-macos-gcc-x64 + path: install/bin/results + retention-days: 7 + + test-linux-clang-x64: + name: Test on Linux with Clang (x64) + runs-on: ubuntu-24.04 + needs: prepare-and-build-linux-clang-x64 + + steps: + # Step: Checkout the repository + - name: Checkout repository + uses: actions/checkout@v4.1.7 + + # Step: Install dependencies using apt-get + - name: Install dependencies + run: sudo apt-get update && sudo apt-get install -y tcl-dev tk-dev cmake clang make libbtbb-dev libx11-dev libglu1-mesa-dev tcllib tcl-thread tcl + + # Step: Install Xvfb and Mesa + - name: Install Xvfb and Mesa + run: | + sudo apt-get update + sudo apt-get install -y xvfb mesa-utils libgl1-mesa-dri + + # Step: Start Xvfb + - name: Start Xvfb + run: Xvfb :99 -screen 0 1920x1080x24 & + + # Step: Set DISPLAY environment variable + - name: Set DISPLAY environment variable + run: echo "DISPLAY=:99" >> $GITHUB_ENV + + # Step: Download test data + - name: Download test data + run: | + cd data + wget https://github.com/Open-Cascade-SAS/OCCT/releases/download/V7_8_0/opencascade-dataset-7.8.0.tar.xz + tar -xf opencascade-dataset-7.8.0.tar.xz + + # Step: Download and extract install directory + - name: Download and extract install directory + uses: actions/download-artifact@v4.1.0 + with: + name: install-linux-clang-x64 + path: install + + # Step: Set LIBGL_ALWAYS_SOFTWARE environment variable + - name: Set LIBGL_ALWAYS_SOFTWARE environment variable + run: echo "LIBGL_ALWAYS_SOFTWARE=1" >> $GITHUB_ENV + + # Step: Set execute permissions on DRAWEXE + - name: Set execute permissions on DRAWEXE + run: chmod +x install/bin/DRAWEXE + + # Step: Run tests + - name: Run tests + run: | + cd install + cd bin + source env.sh + ./DRAWEXE -v -c testgrid + shell: bash + env: + DISPLAY: :99 + LIBGL_ALWAYS_SOFTWARE: 1 + CSF_TestScriptsPath: ${{ github.workspace }}/tests + CSF_TestDataPath: ${{ github.workspace }}/data + + # Step: Upload test results + - name: Upload test results + uses: actions/upload-artifact@v4.4.3 + id: artifact-upload-step + with: + name: results-linux-clang-x64 + path: install/bin/results + retention-days: 7 + + test-linux-gcc-x64: + name: Test on Linux with GCC (x64) + runs-on: ubuntu-24.04 + needs: prepare-and-build-linux-gcc-x64 + + steps: + # Step: Checkout the repository + - name: Checkout repository + uses: actions/checkout@v4.1.7 + + # Step: Install dependencies using apt-get + - name: Install dependencies + run: sudo apt-get update && sudo apt-get install -y tcl-dev tk-dev cmake gcc g++ make libbtbb-dev libx11-dev libglu1-mesa-dev tcllib tcl-thread tcl + + # Step: Install Xvfb and Mesa + - name: Install Xvfb and Mesa + run: | + sudo apt-get update + sudo apt-get install -y xvfb mesa-utils libgl1-mesa-dri + + # Step: Start Xvfb + - name: Start Xvfb + run: Xvfb :99 -screen 0 1920x1080x24 & + + # Step: Set DISPLAY environment variable + - name: Set DISPLAY environment variable + run: echo "DISPLAY=:99" >> $GITHUB_ENV + + # Step: Download test data + - name: Download test data + run: | + cd data + wget https://github.com/Open-Cascade-SAS/OCCT/releases/download/V7_8_0/opencascade-dataset-7.8.0.tar.xz + tar -xf opencascade-dataset-7.8.0.tar.xz + + # Step: Download and extract install directory + - name: Download and extract install directory + uses: actions/download-artifact@v4.1.0 + with: + name: install-linux-gcc-x64 + path: install + + # Step: Set LIBGL_ALWAYS_SOFTWARE environment variable + - name: Set LIBGL_ALWAYS_SOFTWARE environment variable + run: echo "LIBGL_ALWAYS_SOFTWARE=1" >> $GITHUB_ENV + + # Step: Set execute permissions on DRAWEXE + - name: Set execute permissions on DRAWEXE + run: chmod +x install/bin/DRAWEXE + + # Step: Run tests + - name: Run tests + run: | + cd install + cd bin + source env.sh + ./DRAWEXE -v -c testgrid + shell: bash + env: + DISPLAY: :99 + LIBGL_ALWAYS_SOFTWARE: 1 + CSF_TestScriptsPath: ${{ github.workspace }}/tests + CSF_TestDataPath: ${{ github.workspace }}/data + + # Step: Upload test results + - name: Upload test results + uses: actions/upload-artifact@v4.4.3 + id: artifact-upload-step + with: + name: results-linux-gcc-x64 + path: install/bin/results + retention-days: 7 + + summarize: + name: Summarize and Send PR Message + runs-on: ubuntu-24.04 + needs: [test-windows-x64, test-windows-clang-x64, test-macos-x64, test-macos-gcc-x64, test-linux-clang-x64, test-linux-gcc-x64] + + steps: + # Step: Checkout the repository + - name: Checkout repository + uses: actions/checkout@v4.1.7 + + # Step: Download all test results (Windows x64) + - name: Download all test results (Windows x64) + uses: actions/download-artifact@v4.1.0 + with: + name: results-windows-x64 + path: results/windows-x64 + + # Step: Download all test results (Windows Clang x64) + - name: Download all test results (Windows Clang x64) + uses: actions/download-artifact@v4.1.0 + with: + name: results-windows-clang-x64 + path: results/windows-clang-x64 + + # Step: Download all test results (macOS x64) + - name: Download all test results (macOS x64) + uses: actions/download-artifact@v4.1.0 + with: + name: results-macos-x64 + path: results/macos-x64 + + # Step: Download all test results (macOS GCC x64) + - name: Download all test results (macOS GCC x64) + uses: actions/download-artifact@v4.1.0 + with: + name: results-macos-gcc-x64 + path: results/macos-gcc-x64 + + # Step: Download all test results (Linux Clang x64) + - name: Download all test results (Linux Clang x64) + uses: actions/download-artifact@v4.1.0 + with: + name: results-linux-clang-x64 + path: results/linux-clang-x64 + + # Step: Download all test results (Linux GCC x64) + - name: Download all test results (Linux GCC x64) + uses: actions/download-artifact@v4.1.0 + with: + name: results-linux-gcc-x64 + path: results/linux-gcc-x64 + + # Step: Summarize results + - name: Summarize results + run: | + echo "Summarizing results..." + + # Step: Send PR message + - name: Send PR message + run: | + echo "Sending PR message..." diff --git a/.github/workflows/build-doc-refman.yml b/.github/workflows/build-doc-refman.yml deleted file mode 100644 index 8992cbf8f4..0000000000 --- a/.github/workflows/build-doc-refman.yml +++ /dev/null @@ -1,36 +0,0 @@ -# This workflow will build OCCT refman documentation. - -name: Build Refman Documentation - -on: - push: - branches: - - 'master' - -jobs: - build: - runs-on: ubuntu-latest - - steps: - - name: Checkout repository - uses: actions/checkout@v4.2.1 - - - name: Install dependencies - run: sudo apt-get update && sudo apt-get install -y tcl-dev tk-dev cmake gcc g++ make libbtbb-dev libx11-dev libglu1-mesa-dev doxygen graphviz - - - name: Build documentation - run: bash gendoc -refman - - - name: Upload refman documentation - uses: actions/upload-artifact@v4.4.3 - id: artifact-upload-step - with: - name: refman-doc - path: doc/refman - retention-days: 90 - - - name: Upload generation log - uses: actions/upload-artifact@v4.4.3 - with: - name: dogygen.log - path: doc/html_doxygen_err.log diff --git a/.github/workflows/build-docs.yml b/.github/workflows/build-docs.yml new file mode 100644 index 0000000000..a99c773769 --- /dev/null +++ b/.github/workflows/build-docs.yml @@ -0,0 +1,45 @@ +# This workflow builds the OCCT reference manual documentation. +# It is triggered on pushes to the 'master' branch. +# The workflow includes steps to checkout the repository, install dependencies, build the documentation, and upload the generated documentation and logs as artifacts. + +name: Build Documentation + +on: + push: + branches: + - 'master' + +jobs: + build: + name: Build Refman Documentation + runs-on: ubuntu-24.04 + + steps: + # Step: Checkout the repository + - name: Checkout repository + uses: actions/checkout@v4.2.1 + + # Step: Install necessary dependencies for building the documentation + - name: Install dependencies + run: sudo apt-get update && sudo apt-get install -y tcl-dev tk-dev cmake gcc g++ make libbtbb-dev libx11-dev libglu1-mesa-dev doxygen graphviz + + # Step: Build the reference manual documentation + - name: Build documentation + run: bash gendoc -refman + + # Step: Upload the generated reference manual documentation as an artifact + - name: Upload refman documentation + uses: actions/upload-artifact@v4.4.3 + id: artifact-upload-step + with: + name: refman-doc + path: doc/refman + retention-days: 90 + + # Step: Upload the documentation generation log as an artifact + - name: Upload generation log + uses: actions/upload-artifact@v4.4.3 + with: + name: doxygen.log + path: doc/html_doxygen_err.log + retention-days: 90 diff --git a/.github/workflows/build-linux-clang-x64-dynamic.yml b/.github/workflows/build-linux-clang-x64-dynamic.yml deleted file mode 100644 index fe9a50c4a3..0000000000 --- a/.github/workflows/build-linux-clang-x64-dynamic.yml +++ /dev/null @@ -1,42 +0,0 @@ -# This workflow will build OCCT on Ubuntu with Clang compiler -# using the provided Docker image with Clang tools. -# -# Notes: -# freetype is disabled -# samples are not built - -name: Build OCCT on Linux with Clang x64 dynamic - -on: - pull_request: - branches: - - '**' - -jobs: - build-linux-clang: - name: Build on Ubuntu with Clang - runs-on: ubuntu-latest - - steps: - - name: Checkout repository - uses: actions/checkout@v4.1.7 - - - name: Install dependencies - run: sudo apt-get update && sudo apt-get install -y tcl-dev tk-dev cmake clang make libbtbb-dev libx11-dev libglu1-mesa-dev - - - name: Configure OCCT - run: | - mkdir -p build - cd build - cmake -G "Unix Makefiles" \ - -D CMAKE_C_COMPILER=clang \ - -D CMAKE_CXX_COMPILER=clang++ \ - -D BUILD_USE_PCH=ON \ - -D BUILD_INCLUDE_SYMLINK=ON \ - -D USE_FREETYPE=OFF \ - -D CMAKE_BUILD_TYPE=Release .. - - - name: Build OCCT - run: | - cd build - make -j$(nproc) diff --git a/.github/workflows/build-linux-gcc-x64-dynamic.yml b/.github/workflows/build-linux-gcc-x64-dynamic.yml deleted file mode 100644 index 7985f140c1..0000000000 --- a/.github/workflows/build-linux-gcc-x64-dynamic.yml +++ /dev/null @@ -1,44 +0,0 @@ -# This workflow will build OCCT on Linux with GCC x64 dynamic -# using the provided Docker image with GCC tools. -# -# Notes: -# freetype is disabled -# samples are not built - -name: Build OCCT on Linux with GCC x64 dynamic - -on: - pull_request: - branches: - - '**' - -jobs: - build-linux-gcc: - name: Build on Ubuntu with GCC - runs-on: ubuntu-latest - - steps: - - name: Checkout repository - uses: actions/checkout@v4.1.7 - - - name: Install dependencies - run: sudo apt-get update && sudo apt-get install -y tcl-dev tk-dev cmake gcc g++ make libbtbb-dev libx11-dev libglu1-mesa-dev - - - name: Configure OCCT - run: | - mkdir -p build - cd build - cmake -G "Unix Makefiles" \ - -D CMAKE_C_COMPILER=gcc \ - -D CMAKE_CXX_COMPILER=g++ \ - -D USE_FREETYPE=OFF \ - -D BUILD_USE_PCH=ON \ - -D BUILD_INCLUDE_SYMLINK=ON \ - -D CMAKE_BUILD_TYPE=Release \ - -D CMAKE_C_FLAGS="-Werror -Wno-clobbered -Wmaybe-uninitialized -Wodr -Wno-alloc-size-larger-than" \ - -D CMAKE_CXX_FLAGS="-Werror -Wno-clobbered -Wno-dangling-pointer" .. - - - name: Build OCCT - run: | - cd build - make -j$(nproc) diff --git a/.github/workflows/build-macos-clang-x64-dynamic.yml b/.github/workflows/build-macos-clang-x64-dynamic.yml deleted file mode 100644 index be1e38c115..0000000000 --- a/.github/workflows/build-macos-clang-x64-dynamic.yml +++ /dev/null @@ -1,45 +0,0 @@ -# This workflow builds OCCT on macOS with Clang x64 dynamic. -# -# Notes: -# freetype is disabled -# samples are not built - -name: Build OCCT on macOS with Clang x64 dynamic - -on: - pull_request: - branches: - - '**' - -jobs: - build-macos-clang: - name: Build on macOS with Clang - runs-on: macos-latest - - steps: - - name: Checkout repository - uses: actions/checkout@v4.1.7 - - - name: Install dependencies - run: | - brew update - brew install tcl-tk tbb gl2ps xerces-c \ - libxmu libxi libxft libxpm \ - glew - - - name: Configure OCCT - run: | - mkdir -p build - cd build - cmake -G "Unix Makefiles" \ - -D CMAKE_C_COMPILER=clang \ - -D CMAKE_CXX_COMPILER=clang++ \ - -D USE_FREETYPE=OFF \ - -D BUILD_USE_PCH=ON \ - -D BUILD_INCLUDE_SYMLINK=ON \ - -D CMAKE_BUILD_TYPE=Release .. - - - name: Build OCCT - run: | - cd build - make -j$(sysctl -n hw.logicalcpu) diff --git a/.github/workflows/build-windows-msvc-x64-dynamic.yml b/.github/workflows/build-windows-msvc-x64-dynamic.yml deleted file mode 100644 index f0fcabdf8b..0000000000 --- a/.github/workflows/build-windows-msvc-x64-dynamic.yml +++ /dev/null @@ -1,44 +0,0 @@ -# This workflow will build OCCT on Windows with MSVC x64 in dynamic mode -# using the provided Docker image with MSVC tools. -# -# Notes: -# freetype is disabled -# Draw module is disabled -# samples are not built - -name: Build OCCT on Windows with MSVC x64 dynamic - -on: - pull_request: - branches: - - '**' - -jobs: - build-windows-msvc: - name: Build on Windows with MSVC - runs-on: windows-latest - - steps: - - name: Checkout repository - uses: actions/checkout@v4.1.7 - - - name: Set up MSVC - uses: ilammy/msvc-dev-cmd@v1.13.0 - with: - arch: x64 - - - name: Install dependencies - run: | - choco install cmake --installargs 'ADD_CMAKE_TO_PATH=System' -y - choco install magicsplat-tcl-tk -y - - - name: Configure OCCT - run: | - mkdir build - cd build - cmake -T host=x64 -D USE_FREETYPE=OFF -D BUILD_USE_PCH=ON -D BUILD_INCLUDE_SYMLINK=ON -D BUILD_MODULE_Draw=OFF -D CMAKE_BUILD_TYPE=Release -D CMAKE_C_FLAGS="/WX" -D CMAKE_CXX_FLAGS="/WX" .. - - - name: Build OCCT - run: | - cd build - cmake --build . --config Release -- /m diff --git a/.github/workflows/code-analysis.yml b/.github/workflows/code-analysis.yml new file mode 100644 index 0000000000..73114df123 --- /dev/null +++ b/.github/workflows/code-analysis.yml @@ -0,0 +1,97 @@ +# This workflow performs code analysis using both CodeQL and Microsoft C++ Code Analysis. +# It is triggered on pushes to the 'master' branch and publishes warnings into the security GitHub tab. +# The workflow includes two jobs: one for CodeQL analysis on Ubuntu and another for MSVC Code Analysis on Windows. + +name: Code Analysis + +on: + push: + branches: + - 'master' + +permissions: + contents: read + security-events: write + packages: read + +env: + # Path to the CMake build directory. + build: '${{ github.workspace }}/build' + config: 'Debug' + +jobs: + codeql-analyze: + name: CodeQL Analyze (C/C++) + runs-on: ubuntu-latest + + steps: + # Step: Checkout the repository + - name: Checkout repository + uses: actions/checkout@v4.1.7 + + # Step: Install necessary dependencies for building the project + - name: Install dependencies + run: sudo apt-get update && sudo apt-get install -y tcl-dev tk-dev cmake gcc g++ make libbtbb-dev libx11-dev libglu1-mesa-dev + + # Step: Initialize CodeQL for scanning + - name: Initialize CodeQL + uses: github/codeql-action/init@v3.26.5 + with: + languages: c-cpp + build-mode: manual + + # Step: Build the project using CMake and Make + - name: Build project + shell: bash + run: | + mkdir -p build + cd build + cmake -G "Unix Makefiles" \ + -D CMAKE_C_COMPILER=gcc \ + -D CMAKE_CXX_COMPILER=g++ \ + -D USE_FREETYPE=OFF \ + -D CMAKE_BUILD_TYPE=Release .. + make -j$(nproc) + + # Step: Perform CodeQL Analysis + - name: Perform CodeQL Analysis + uses: github/codeql-action/analyze@v3.26.5 + with: + category: "/language:c-cpp" + + msvc-analyze: + name: Microsoft C++ Code Analysis + runs-on: windows-latest + + steps: + # Step: Checkout the repository + - name: Checkout repository + uses: actions/checkout@v4.1.7 + + # Step: Install necessary dependencies using Chocolatey + - name: Install dependencies + run: | + choco install cmake --installargs 'ADD_CMAKE_TO_PATH=System' -y + choco install magicsplat-tcl-tk -y + + # Step: Configure the project using CMake + - name: Configure CMake + run: | + mkdir build + cd build + cmake -D USE_FREETYPE=OFF -DCMAKE_BUILD_TYPE=${{ env.config }} .. + + # Step: Run MSVC Code Analysis + - name: Run MSVC Code Analysis + uses: microsoft/msvc-code-analysis-action@v0.1.1 + id: run-analysis + with: + cmakeBuildDirectory: ${{ env.build }} + buildConfiguration: ${{ env.config }} + ruleset: NativeRecommendedRules.ruleset + + # Step: Upload SARIF file to GitHub Code Scanning Alerts + - name: Upload SARIF to GitHub + uses: github/codeql-action/upload-sarif@v3.26.5 + with: + sarif_file: ${{ steps.run-analysis.outputs.sarif }} diff --git a/.github/workflows/codemsvc.yml b/.github/workflows/codemsvc.yml deleted file mode 100644 index a69792fe86..0000000000 --- a/.github/workflows/codemsvc.yml +++ /dev/null @@ -1,62 +0,0 @@ -# Security scanning with Microsoft C++ Code Analysis. -# Checks any master integration and publish warnings into security GitHub tab. -# -# Find more information at: -# https://github.com/microsoft/msvc-code-analysis-action - -name: Microsoft C++ Code Analysis - -on: - push: - branches: - - 'master' - -env: - # Path to the CMake build directory. - build: '${{ github.workspace }}/build' - config: 'Debug' - -permissions: - contents: read - -jobs: - analyze: - permissions: - contents: read # for actions/checkout to fetch code - security-events: write # for github/codeql-action/upload-sarif to upload SARIF results - actions: read # only required for a private repository by github/codeql-action/upload-sarif to get the Action run status - name: Analyze - runs-on: windows-latest - - steps: - - name: Checkout repository - uses: actions/checkout@v4.1.7 - - - name: Install dependencies - run: | - choco install cmake --installargs 'ADD_CMAKE_TO_PATH=System' -y - choco install magicsplat-tcl-tk -y - - - name: Configure CMake - run: | - mkdir build - cd build - cmake -D USE_FREETYPE=OFF -DCMAKE_BUILD_TYPE=${{ env.config }} .. - - - name: Run MSVC Code Analysis - uses: microsoft/msvc-code-analysis-action@v0.1.1 - # Provide a unique ID to access the sarif output path - id: run-analysis - with: - cmakeBuildDirectory: ${{ env.build }} - buildConfiguration: ${{ env.config }} - # Ruleset file that will determine what checks will be run - ruleset: NativeRecommendedRules.ruleset - # Paths to ignore analysis of CMake targets and includes - # ignoredPaths: ${{ github.workspace }}/dependencies;${{ github.workspace }}/test - - # Upload SARIF file to GitHub Code Scanning Alerts - - name: Upload SARIF to GitHub - uses: github/codeql-action/upload-sarif@v3.26.5 - with: - sarif_file: ${{ steps.run-analysis.outputs.sarif }} diff --git a/.github/workflows/codeql.yml b/.github/workflows/codeql.yml deleted file mode 100644 index e89acd5ce6..0000000000 --- a/.github/workflows/codeql.yml +++ /dev/null @@ -1,60 +0,0 @@ -# Security scanning with CodeQL. -# Checks any master integration and publish warnings into security GitHub tab. -# -# Find more information at: -# https://docs.github.com/en/github/finding-security-vulnerabilities-and-errors-in-your-code/about-code-scanning - -name: CodeQL Code Analysis - -on: - push: - branches: - - 'master' - -jobs: - analyze: - name: Analyze (${{ matrix.language }}) - runs-on: ${{ 'ubuntu-latest' }} - permissions: - # required for all workflows - security-events: write - - # required to fetch internal or private CodeQL packs - packages: read - - strategy: - fail-fast: false - matrix: - include: - - language: c-cpp - build-mode: manual - steps: - - name: Checkout repository - uses: actions/checkout@v4.1.7 - - - name: Install dependencies - run: sudo apt-get update && sudo apt-get install -y tcl-dev tk-dev cmake gcc g++ make libbtbb-dev libx11-dev libglu1-mesa-dev - - # Initializes the CodeQL tools for scanning. - - name: Initialize CodeQL - uses: github/codeql-action/init@v3.26.5 - with: - languages: ${{ matrix.language }} - build-mode: ${{ matrix.build-mode }} - - - if: matrix.build-mode == 'manual' - shell: bash - run: | - mkdir -p build - cd build - cmake -G "Unix Makefiles" \ - -D CMAKE_C_COMPILER=gcc \ - -D CMAKE_CXX_COMPILER=g++ \ - -D USE_FREETYPE=OFF \ - -D CMAKE_BUILD_TYPE=Release .. - make -j$(nproc) - - - name: Perform CodeQL Analysis - uses: github/codeql-action/analyze@v3.26.5 - with: - category: "/language:${{matrix.language}}"