@@ -17,62 +17,96 @@ jobs:
1717 # The CMake configure and build commands are platform agnostic and should work equally well on Windows or Mac.
1818 # You can convert this to a matrix build if you need cross-platform coverage.
1919 # See: https://docs.github.com/en/free-pro-team@latest/actions/learn-github-actions/managing-complex-workflows#using-a-build-matrix
20- runs-on : ubuntu -latest
20+ runs-on : windows -latest
2121
2222 steps :
2323 - uses : actions/checkout@v4
2424
25- - name : Install dependencies
25+ - name : Install NuGet
26+ uses : nuget/setup-nuget@v1
27+ with :
28+ nuget-version : ' latest'
29+
30+ - name : Install Chocolatey dependencies
31+ shell : pwsh
2632 run : |
27- sudo apt-get update
28- sudo apt-get install -y \
29- libopencascade-dev \
30- libboost-dev \
31- libgl1-mesa-dev \
32- libglfw3-dev \
33- libglew-dev \
34- libxinerama-dev \
35- libxcursor-dev \
36- libxi-dev \
37- build-essential \
38- cmake
33+ choco install cmake --installargs 'ADD_CMAKE_TO_PATH=System' -y
3934
40- - name : Find OpenCASCADE installation path
41- id : find_occt
35+ - name : Download and extract OpenCASCADE
36+ shell : pwsh
4237 run : |
43- # Find OpenCASCADE CMake config file
44- OCCT_CONFIG=$(find /usr -name "OpenCASCADEConfig.cmake" -o -name "opencascade-config.cmake" 2>/dev/null | head -1)
45- if [ -n "$OCCT_CONFIG" ]; then
46- OCCT_DIR=$(dirname "$OCCT_CONFIG")
47- echo "OpenCASCADE_DIR=$OCCT_DIR" >> $GITHUB_ENV
48- echo "Found OpenCASCADE at: $OCCT_DIR"
49- else
50- # Try common installation paths
51- for path in "/usr/lib/x86_64-linux-gnu/cmake/opencascade" "/usr/lib/cmake/opencascade" "/usr/share/cmake/opencascade"; do
52- if [ -d "$path" ]; then
53- echo "OpenCASCADE_DIR=$path" >> $GITHUB_ENV
54- echo "Found OpenCASCADE at: $path"
55- exit 0
56- fi
57- done
58- echo "ERROR: Could not find OpenCASCADE installation"
59- echo "Searching for OpenCASCADE files..."
60- find /usr -name "*OpenCASCADE*" -o -name "*opencascade*" 2>/dev/null | head -20
61- exit 1
62- fi
38+ # OpenCASCADE 7.8.0 pre-built binaries for Windows
39+ $OCCT_VERSION = "7.8.0"
40+ $OCCT_URL = "https://dev.opencascade.org/system/files/occt/OCC-$OCCT_VERSION-VC14-64.zip"
41+ $OCCT_ZIP = "$env:RUNNER_TEMP\occt.zip"
42+ $OCCT_EXTRACT_DIR = "$env:RUNNER_TEMP\occt"
43+
44+ Write-Host "Downloading OpenCASCADE $OCCT_VERSION from $OCCT_URL..."
45+ try {
46+ Invoke-WebRequest -Uri $OCCT_URL -OutFile $OCCT_ZIP -UseBasicParsing
47+ Write-Host "Download completed"
48+ } catch {
49+ Write-Host "Failed to download from primary URL, trying alternative..."
50+ # Try alternative URL format
51+ $OCCT_URL = "https://github.com/Open-Cascade-SAS/OCCT/releases/download/V$OCCT_VERSION/opencascade-$OCCT_VERSION-windows-x64.zip"
52+ Invoke-WebRequest -Uri $OCCT_URL -OutFile $OCCT_ZIP -UseBasicParsing
53+ }
54+
55+ Write-Host "Extracting OpenCASCADE..."
56+ if (Test-Path $OCCT_EXTRACT_DIR) {
57+ Remove-Item -Path $OCCT_EXTRACT_DIR -Recurse -Force
58+ }
59+ Expand-Archive -Path $OCCT_ZIP -DestinationPath $OCCT_EXTRACT_DIR -Force
60+
61+ # Find OpenCASCADEConfig.cmake - it might be in various locations
62+ $OCCT_CONFIG = Get-ChildItem -Path $OCCT_EXTRACT_DIR -Recurse -Filter "OpenCASCADEConfig.cmake" -ErrorAction SilentlyContinue | Select-Object -First 1
63+ if ($OCCT_CONFIG) {
64+ $OCCT_CMAKE_DIR = $OCCT_CONFIG.DirectoryName
65+ Write-Host "Found OpenCASCADE CMake config at: $OCCT_CMAKE_DIR"
66+ echo "OpenCASCADE_DIR=$OCCT_CMAKE_DIR" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
67+ } else {
68+ # Try to find it in common locations
69+ $possiblePaths = @(
70+ "$OCCT_EXTRACT_DIR\opencascade-$OCCT_VERSION\cmake",
71+ "$OCCT_EXTRACT_DIR\OCC-$OCCT_VERSION-VC14-64\cmake",
72+ "$OCCT_EXTRACT_DIR\cmake",
73+ "$OCCT_EXTRACT_DIR\lib\cmake\opencascade"
74+ )
75+ $found = $false
76+ foreach ($path in $possiblePaths) {
77+ if (Test-Path $path) {
78+ Write-Host "Using OpenCASCADE path: $path"
79+ echo "OpenCASCADE_DIR=$path" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
80+ $found = $true
81+ break
82+ }
83+ }
84+ if (-not $found) {
85+ Write-Host "Warning: Could not find OpenCASCADE CMake config. Listing directory structure:"
86+ Get-ChildItem -Path $OCCT_EXTRACT_DIR -Recurse -Directory | Select-Object -First 10 | ForEach-Object { Write-Host $_.FullName }
87+ exit 1
88+ }
89+ }
90+
91+ Write-Host "OpenCASCADE_DIR is set to: $env:OpenCASCADE_DIR"
6392
6493 - name : Configure CMake
94+ shell : pwsh
6595 # Configure CMake in a 'build' subdirectory. `CMAKE_BUILD_TYPE` is only required if you are using a single-configuration generator such as make.
6696 # See https://cmake.org/cmake/help/latest/variable/CMAKE_BUILD_TYPE.html?highlight=cmake_build_type
67- run : cmake -B ${{github.workspace}}/build -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} -DOpenCASCADE_DIR=${{env.OpenCASCADE_DIR}}
97+ run : |
98+ cmake -B ${{github.workspace}}\build `
99+ -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} `
100+ -DOpenCASCADE_DIR="${{env.OpenCASCADE_DIR}}"
68101
69102 - name : Build
103+ shell : pwsh
70104 # Build your program with the given configuration
71- run : cmake --build ${{github.workspace}}/ build --config ${{env.BUILD_TYPE}}
105+ run : cmake --build ${{github.workspace}}\ build --config ${{env.BUILD_TYPE}}
72106
73107 - name : Test
74- working-directory : ${{github.workspace}}/build
108+ working-directory : ${{github.workspace}}\build
109+ shell : pwsh
75110 # Execute tests defined by the CMake configuration.
76111 # See https://cmake.org/cmake/help/latest/manual/ctest.1.html for more detail
77112 run : ctest -C ${{env.BUILD_TYPE}} --output-on-failure
78-
0 commit comments