# Master validation workflow that combines multiple build configurations # This workflow is triggered only on pushes to the master branch of the main repository # It includes Windows (MSVC, MinGW), Ubuntu, vcpkg builds, and code analysis name: Master Validation on: push: branches: - master workflow_dispatch: concurrency: group: ${{ github.workflow }} cancel-in-progress: true jobs: # Windows MSVC/Clang builds windows-msvc: if: github.repository == 'Open-Cascade-SAS/OCCT' name: Windows MSVC/Clang validation runs-on: windows-2025 strategy: fail-fast: false matrix: config: - { name: "MSVC", cc: "cl", cxx: "cl", generator: "Visual Studio 17 2022", toolset: "host=x64", c_flags: "/W4 /WX", cxx_flags: "/W4 /WX" } - { name: "Clang", cc: "clang", cxx: "clang++", generator: "Ninja", toolset: "", c_flags: "-Werror -Wall -Wextra -Wno-unknown-warning-option -Wno-error=cast-function-type-mismatch", cxx_flags: "-Werror -Wall -Wextra -Wno-unknown-warning-option -Wno-error=cast-function-type-mismatch" } steps: - name: Checkout repository uses: actions/checkout@v4.2.2 - name: Setup Windows MSVC dependencies uses: ./.github/actions/setup-windows-msvc-deps - name: Build basic configuration uses: ./.github/actions/cmake-build-basic with: generator: ${{ matrix.config.generator }} cc: ${{ matrix.config.cc }} cxx: ${{ matrix.config.cxx }} build-type: "Release" thirdparty-dir: ${{ github.workspace }}/3rdparty-vc14-64 compiler-flags: "${{ matrix.config.toolset != '' && format('-T {0}', matrix.config.toolset) || '' }} -D CMAKE_CXX_FLAGS=\"${{ matrix.config.cxx_flags }}\" -D CMAKE_C_FLAGS=\"${{ matrix.config.c_flags }}\"" - name: Build full shared configuration uses: ./.github/actions/cmake-build-full with: generator: ${{ matrix.config.generator }} cc: ${{ matrix.config.cc }} cxx: ${{ matrix.config.cxx }} build-type: "Debug" library-type: "Shared" opt-profile: "Production" thirdparty-dir: ${{ github.workspace }}/3rdparty-vc14-64 compiler-flags: "${{ matrix.config.toolset != '' && format('-T {0}', matrix.config.toolset) || '' }} -D CMAKE_CXX_FLAGS=\"${{ matrix.config.cxx_flags }}\" -D CMAKE_C_FLAGS=\"${{ matrix.config.c_flags }}\" -D USE_FFMPEG=ON" use-vtk: ${{ matrix.config.name == 'MSVC' && 'ON' || 'OFF' }} use-tbb: "ON" # Windows MinGW builds windows-mingw: if: github.repository == 'Open-Cascade-SAS/OCCT' name: Windows MinGW validation runs-on: windows-2025 strategy: fail-fast: false matrix: config: - { name: "GCC", cc: "x86_64-w64-mingw32-gcc", cxx: "x86_64-w64-mingw32-g++", package: "mingw-w64-x86_64-toolchain", msystem: "MINGW64", compiler_flags: "", dependencies: "mingw-w64-x86_64-cmake mingw-w64-x86_64-ninja mingw-w64-x86_64-rapidjson mingw-w64-x86_64-freetype mingw-w64-x86_64-draco mingw-w64-x86_64-freeimage mingw-w64-x86_64-tbb mingw-w64-x86_64-tk mingw-w64-x86_64-tcl mingw-w64-x86_64-openvr mingw-w64-x86_64-jemalloc mingw-w64-x86_64-mesa mingw-w64-x86_64-angleproject mingw-w64-x86_64-llvm-openmp mingw-w64-x86_64-winpthreads-git mingw-w64-x86_64-libwinpthread-git mingw-w64-cross-mingwarm64-winpthreads" } - { name: "Clang", cc: "clang", cxx: "clang++", package: "mingw-w64-clang-x86_64-toolchain", msystem: "CLANG64", compiler_flags: "-D CMAKE_CXX_FLAGS=\"-Wall -Wextra\" -D CMAKE_C_FLAGS=\"-Wall -Wextra\"", dependencies: "mingw-w64-clang-x86_64-cmake mingw-w64-clang-x86_64-ninja mingw-w64-clang-x86_64-rapidjson mingw-w64-clang-x86_64-freetype mingw-w64-clang-x86_64-draco mingw-w64-clang-x86_64-freeimage mingw-w64-clang-x86_64-tbb mingw-w64-clang-x86_64-tk mingw-w64-clang-x86_64-tcl mingw-w64-clang-x86_64-openvr mingw-w64-clang-x86_64-jemalloc mingw-w64-clang-x86_64-mesa mingw-w64-clang-x86_64-angleproject mingw-w64-clang-x86_64-llvm-openmp mingw-w64-clang-x86_64-winpthreads-git mingw-w64-clang-x86_64-libwinpthread-git mingw-w64-cross-mingwarm64-winpthreads" } build_type: [Debug, Release] steps: - name: Checkout repository uses: actions/checkout@v4.2.2 - name: Setup MSYS2 uses: ./.github/actions/setup-msys2 with: msystem: ${{ matrix.config.msystem }} packages: ${{ matrix.config.package }} dependencies: ${{ matrix.config.dependencies }} - name: Build basic configuration uses: ./.github/actions/cmake-build-basic with: generator: "Ninja" cc: ${{ matrix.config.cc }} cxx: ${{ matrix.config.cxx }} build-type: ${{ matrix.build_type }} shell-type: "msys2" compiler-flags: ${{ matrix.config.compiler_flags }} - name: Build full shared configuration uses: ./.github/actions/cmake-build-full with: generator: "Ninja" cc: ${{ matrix.config.cc }} cxx: ${{ matrix.config.cxx }} build-type: ${{ matrix.build_type }} library-type: "Shared" opt-profile: "Production" shell-type: "msys2" compiler-flags: ${{ matrix.config.compiler_flags }} use-vtk: "OFF" use-tbb: "OFF" # Windows ARM64 test lane moved from PR validation. windows-arm64-prepare-build: if: github.repository == 'Open-Cascade-SAS/OCCT' name: Windows ARM64 build runs-on: windows-11-arm steps: - name: Checkout repository uses: actions/checkout@v4.2.2 - name: Build OCCT uses: ./.github/actions/build-occt with: platform: windows compiler: msvc target-arch: arm64 artifact-name: install-windows-arm64 github-token: ${{ secrets.GITHUB_TOKEN }} windows-arm64-test: if: github.repository == 'Open-Cascade-SAS/OCCT' name: Test on Windows (arm64) runs-on: windows-11-arm needs: windows-arm64-prepare-build steps: - name: Checkout repository uses: actions/checkout@v4.2.2 - name: Run tests uses: ./.github/actions/run-tests with: platform: windows compiler: msvc target-arch: arm64 install-artifact-name: install-windows-arm64 test-directory-name: windows-arm64 test-script: .github/actions/testgrid/testwindowsarm.tcl windows-arm64-retest: if: github.repository == 'Open-Cascade-SAS/OCCT' name: Regression Test on Windows (arm64) runs-on: windows-11-arm needs: windows-arm64-test steps: - name: Checkout repository uses: actions/checkout@v4.2.2 - name: Run retest uses: ./.github/actions/retest-failures with: platform: windows compiler: msvc target-arch: arm64 install-artifact-name: install-windows-arm64 results-artifact-name: results-windows-arm64 test-directory-name: windows-arm64 windows-arm64-gtest: if: github.repository == 'Open-Cascade-SAS/OCCT' name: Run GTest on Windows with MSVC (arm64) needs: windows-arm64-prepare-build runs-on: windows-11-arm steps: - name: Checkout repository uses: actions/checkout@v4.2.2 - name: Run GTests uses: ./.github/actions/run-gtest with: platform: windows compiler: msvc target-arch: arm64 install-artifact-name: install-windows-arm64 artifact-suffix: arm64 # Ubuntu builds ubuntu: if: github.repository == 'Open-Cascade-SAS/OCCT' name: Ubuntu validation runs-on: ubuntu-24.04 strategy: fail-fast: false matrix: config: - { name: "GCC", cc: "gcc", cxx: "g++", compiler_flags: "" } - { name: "Clang", cc: "clang", cxx: "clang++", compiler_flags: "-D CMAKE_CXX_FLAGS=\"-Werror -Wall -Wextra\" -D CMAKE_C_FLAGS=\"-Werror -Wall -Wextra\"" } build_type: [Debug, Release] steps: - name: Checkout repository uses: actions/checkout@v4.2.2 - name: Setup Ubuntu dependencies uses: ./.github/actions/setup-ubuntu-deps - name: Build basic configuration uses: ./.github/actions/cmake-build-basic with: generator: "Ninja" cc: ${{ matrix.config.cc }} cxx: ${{ matrix.config.cxx }} build-type: ${{ matrix.build_type }} compiler-flags: ${{ matrix.config.compiler_flags }} - name: Build full shared configuration uses: ./.github/actions/cmake-build-full with: generator: "Ninja" cc: ${{ matrix.config.cc }} cxx: ${{ matrix.config.cxx }} build-type: ${{ matrix.build_type }} library-type: "Shared" opt-profile: "Production" compiler-flags: ${{ matrix.config.compiler_flags }} rapidjson-dir: ${{ github.workspace }}/rapidjson-858451e5b7d1c56cf8f6d58f88cf958351837e53 use-vtk: "ON" use-tbb: "ON" # vcpkg builds vcpkg: if: github.repository == 'Open-Cascade-SAS/OCCT' name: vcpkg validation runs-on: ${{ matrix.os }} strategy: fail-fast: false matrix: os: [ubuntu-24.04, ubuntu-22.04, windows-2022, windows-2025, macos-15, macos-14] build_type: [Debug, Release] steps: - name: Checkout repository uses: actions/checkout@v4.2.2 - name: Build OCCT with vcpkg uses: ./.github/actions/build-occt with: platform: ${{ runner.os == 'Windows' && 'windows' || runner.os == 'macOS' && 'macos' || 'linux' }} compiler: ${{ runner.os == 'Windows' && 'msvc' || 'clang' }} artifact-name: occt-${{ matrix.os }}-${{ matrix.build_type }} cmake-build-type: ${{ matrix.build_type }} github-token: ${{ secrets.GITHUB_TOKEN }} # Code analysis codeql-analyze: if: github.repository == 'Open-Cascade-SAS/OCCT' name: CodeQL Analyze (C/C++) runs-on: ubuntu-24.04 permissions: contents: read security-events: write packages: read steps: - name: Checkout repository uses: actions/checkout@v4.2.2 - 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: Initialize CodeQL uses: github/codeql-action/init@v3.26.5 with: languages: c-cpp build-mode: manual - name: Build project for analysis uses: ./.github/actions/cmake-build-basic with: generator: "Unix Makefiles" cc: "gcc" cxx: "g++" build-type: "Release" compiler-flags: "-D USE_FREETYPE=OFF" - name: Perform CodeQL Analysis uses: github/codeql-action/analyze@v3.26.5 with: category: "/language:c-cpp" msvc-analyze: if: github.repository == 'Open-Cascade-SAS/OCCT' name: Microsoft C++ Code Analysis runs-on: windows-2025 permissions: contents: read security-events: write packages: read env: build: '${{ github.workspace }}/build' config: 'Debug' steps: - name: Checkout repository uses: actions/checkout@v4.2.2 - name: Configure OCCT for analysis uses: ./.github/actions/configure-occt with: platform: 'windows' compiler: 'msvc' build-use-pch: 'false' cmake-build-type: ${{ env.config }} github-token: ${{ secrets.GITHUB_TOKEN }} - 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 - name: Upload SARIF to GitHub uses: github/codeql-action/upload-sarif@v3.26.5 with: sarif_file: ${{ steps.run-analysis.outputs.sarif }}