Skip to content

Commit 1c5df65

Browse files
authored
Delete single platform CMake workflow
Removed the CMake workflow for a single platform, which included steps for building, testing, and installing OpenCASCADE.
1 parent 0b8e03f commit 1c5df65

1 file changed

Lines changed: 0 additions & 151 deletions

File tree

Lines changed: 0 additions & 151 deletions
Original file line numberDiff line numberDiff line change
@@ -1,152 +1 @@
1-
# This starter workflow is for a CMake project running on a single platform. There is a different starter workflow if you need cross-platform coverage.
2-
# See: https://github.com/actions/starter-workflows/blob/main/ci/cmake-multi-platform.yml
3-
name: CMake on a single platform
41

5-
on:
6-
push:
7-
branches: [ "main" ]
8-
pull_request:
9-
branches: [ "main" ]
10-
11-
env:
12-
# Customize the CMake build type here (Release, Debug, RelWithDebInfo, etc.)
13-
BUILD_TYPE: Release
14-
15-
jobs:
16-
build:
17-
# The CMake configure and build commands are platform agnostic and should work equally well on Windows or Mac.
18-
# You can convert this to a matrix build if you need cross-platform coverage.
19-
# See: https://docs.github.com/en/free-pro-team@latest/actions/learn-github-actions/managing-complex-workflows#using-a-build-matrix
20-
runs-on: windows-latest
21-
22-
steps:
23-
- uses: actions/checkout@v4
24-
25-
- name: Install NuGet
26-
uses: nuget/setup-nuget@v1
27-
with:
28-
nuget-version: 'latest'
29-
30-
- name: Setup vcpkg
31-
uses: friendlyanon/setup-vcpkg@v1
32-
33-
- name: Try to download pre-built OpenCASCADE
34-
id: download_occt
35-
shell: pwsh
36-
continue-on-error: true
37-
run: |
38-
$OCCT_VERSION = "7.9.1"
39-
$OCCT_EXTRACT_DIR = "$env:RUNNER_TEMP\occt"
40-
$OCCT_ZIP = "$env:RUNNER_TEMP\occt.zip"
41-
42-
# Try multiple possible download URLs
43-
$urls = @(
44-
"https://github.com/Open-Cascade-SAS/OCCT/releases/download/V7_9_1/opencascade-$OCCT_VERSION-vc14-64.zip",
45-
"https://github.com/Open-Cascade-SAS/OCCT/releases/download/V7_9_1/OCC-$OCCT_VERSION-VC14-64.zip",
46-
"https://dev.opencascade.org/system/files/occt/opencascade-$OCCT_VERSION-vc14-64.zip",
47-
"https://dev.opencascade.org/system/files/occt/OCC-$OCCT_VERSION-VC14-64.zip"
48-
)
49-
50-
$downloaded = $false
51-
foreach ($url in $urls) {
52-
try {
53-
Write-Host "Trying to download from: $url"
54-
Invoke-WebRequest -Uri $url -OutFile $OCCT_ZIP -UseBasicParsing -TimeoutSec 30
55-
Write-Host "Successfully downloaded from: $url"
56-
$downloaded = $true
57-
break
58-
} catch {
59-
Write-Host "Failed to download from $url : $_"
60-
continue
61-
}
62-
}
63-
64-
if ($downloaded) {
65-
Write-Host "Extracting OpenCASCADE..."
66-
if (Test-Path $OCCT_EXTRACT_DIR) {
67-
Remove-Item -Path $OCCT_EXTRACT_DIR -Recurse -Force
68-
}
69-
Expand-Archive -Path $OCCT_ZIP -DestinationPath $OCCT_EXTRACT_DIR -Force
70-
71-
# Find OpenCASCADEConfig.cmake
72-
$OCCT_CONFIG = Get-ChildItem -Path $OCCT_EXTRACT_DIR -Recurse -Filter "OpenCASCADEConfig.cmake" -ErrorAction SilentlyContinue | Select-Object -First 1
73-
if ($OCCT_CONFIG) {
74-
$OCCT_CMAKE_DIR = $OCCT_CONFIG.DirectoryName
75-
Write-Host "Found OpenCASCADE CMake config at: $OCCT_CMAKE_DIR"
76-
echo "OpenCASCADE_DIR=$OCCT_CMAKE_DIR" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
77-
echo "USE_VCPKG=false" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
78-
echo "Pre-built binaries found" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
79-
} else {
80-
Write-Host "Warning: Downloaded but could not find OpenCASCADEConfig.cmake"
81-
echo "USE_VCPKG=true" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
82-
}
83-
} else {
84-
Write-Host "Could not download pre-built binaries, will use vcpkg"
85-
echo "USE_VCPKG=true" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
86-
}
87-
88-
- name: Install OpenCASCADE via vcpkg (if needed)
89-
if: env.USE_VCPKG == 'true'
90-
shell: pwsh
91-
run: |
92-
Write-Host "Installing OpenCASCADE via vcpkg (this may take several minutes)..."
93-
vcpkg install opencascade:x64-windows --triplet x64-windows
94-
95-
- name: Find OpenCASCADE CMake config (vcpkg)
96-
if: env.USE_VCPKG == 'true'
97-
shell: pwsh
98-
run: |
99-
$VCPKG_INSTALLED = "$env:VCPKG_ROOT\installed\x64-windows"
100-
101-
# Find OpenCASCADEConfig.cmake
102-
$OCCT_CONFIG = Get-ChildItem -Path $VCPKG_INSTALLED -Recurse -Filter "OpenCASCADEConfig.cmake" -ErrorAction SilentlyContinue | Select-Object -First 1
103-
if ($OCCT_CONFIG) {
104-
$OCCT_CMAKE_DIR = $OCCT_CONFIG.DirectoryName
105-
Write-Host "Found OpenCASCADE CMake config at: $OCCT_CMAKE_DIR"
106-
echo "OpenCASCADE_DIR=$OCCT_CMAKE_DIR" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
107-
} else {
108-
# Try common vcpkg locations
109-
$possiblePaths = @(
110-
"$VCPKG_INSTALLED\share\opencascade",
111-
"$VCPKG_INSTALLED\share\occt"
112-
)
113-
foreach ($path in $possiblePaths) {
114-
if (Test-Path $path) {
115-
Write-Host "Using OpenCASCADE path: $path"
116-
echo "OpenCASCADE_DIR=$path" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
117-
break
118-
}
119-
}
120-
}
121-
122-
Write-Host "OpenCASCADE_DIR is set to: $env:OpenCASCADE_DIR"
123-
124-
- name: Configure CMake
125-
shell: pwsh
126-
# Configure CMake in a 'build' subdirectory. `CMAKE_BUILD_TYPE` is only required if you are using a single-configuration generator such as make.
127-
# See https://cmake.org/cmake/help/latest/variable/CMAKE_BUILD_TYPE.html?highlight=cmake_build_type
128-
run: |
129-
$cmakeArgs = @(
130-
"-B", "${{github.workspace}}\build",
131-
"-DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}}",
132-
"-DOpenCASCADE_DIR=`"${{env.OpenCASCADE_DIR}}`""
133-
)
134-
135-
if ("${{env.USE_VCPKG}}" -eq "true") {
136-
$cmakeArgs += "-DCMAKE_TOOLCHAIN_FILE=`"$env:VCPKG_ROOT\scripts\buildsystems\vcpkg.cmake`""
137-
$cmakeArgs += "-DVCPKG_TARGET_TRIPLET=x64-windows"
138-
}
139-
140-
cmake @cmakeArgs
141-
142-
- name: Build
143-
shell: pwsh
144-
# Build your program with the given configuration
145-
run: cmake --build ${{github.workspace}}\build --config ${{env.BUILD_TYPE}}
146-
147-
- name: Test
148-
working-directory: ${{github.workspace}}\build
149-
shell: pwsh
150-
# Execute tests defined by the CMake configuration.
151-
# See https://cmake.org/cmake/help/latest/manual/ctest.1.html for more detail
152-
run: ctest -C ${{env.BUILD_TYPE}} --output-on-failure

0 commit comments

Comments
 (0)