Skip to content

Configuration - Update CMake to work with default packages #25

Configuration - Update CMake to work with default packages

Configuration - Update CMake to work with default packages #25

# 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:
- name: Checkout repository
uses: actions/[email protected]
- name: Set up MSVC
uses: ilammy/[email protected]
with:
arch: x64
- 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
- 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
- name: Build OCCT
run: |
cd build
cmake --build . --config Release -- /m
- name: Install OCCT
run: |
cd build
cmake --install . --config Release
- name: Upload install directory
uses: actions/[email protected]
with:
name: install-windows-x64
path: install
retention-days: 7
prepare-and-build-windows-clang-x64:
name: Prepare and Build on Windows with Clang (x64)
runs-on: windows-2022
steps:
- name: Checkout repository
uses: actions/[email protected]
- name: Set up MSVC
uses: ilammy/[email protected]
with:
arch: x64
- 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
- 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=ON `
-D USE_OPENVR=ON `
-D USE_VTK=OFF `
-D USE_TBB=ON `
-D USE_RAPIDJSON=ON `
-D USE_OPENGL=ON ..
shell: pwsh
- name: Build OCCT
run: |
cd build
cmake --build . --config Release
- name: Install OCCT
run: |
cd build
cmake --install . --config Release
- name: Upload install directory
uses: actions/[email protected]
with:
name: install-windows-clang-x64
path: install
retention-days: 7
prepare-and-build-macos-x64:
name: Prepare and Build on macOS with Clang (x64)
runs-on: macos-15
steps:
- name: Checkout repository
uses: actions/[email protected]
- name: Install dependencies
run: |
brew update
brew install tcl-tk tbb gl2ps xerces-c \
libxmu libxi libxft libxpm \
glew freetype freeimage draco glfw
- name: Install rapidjson
run: |
wget https://github.com/Tencent/rapidjson/archive/858451e5b7d1c56cf8f6d58f88cf958351837e53.zip -O rapidjson.zip
unzip rapidjson.zip
- 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 CMAKE_BUILD_TYPE=Release \
-D INSTALL_DIR=${{ github.workspace }}/install \
-D 3RDPARTY_RAPIDJSON_DIR=${{ github.workspace }}/rapidjson-858451e5b7d1c56cf8f6d58f88cf958351837e53 \
-D USE_RAPIDJSON=ON \
-D USE_DRACO=ON \
-D USE_FREETYPE=ON \
-D USE_OPENGL=ON \
-D USE_FREEIMAGE=ON ..
- name: Build OCCT
run: |
cd build
make -j$(sysctl -n hw.logicalcpu)
- name: Install OCCT
run: |
cd build
make install
- name: Upload install directory
uses: actions/[email protected]
with:
name: install-macos-x64
path: install
retention-days: 7
prepare-and-build-macos-gcc-x64:
name: Prepare and Build on macOS with GCC (x64)
runs-on: macos-15
steps:
- name: Checkout repository
uses: actions/[email protected]
- name: Install dependencies
run: |
brew update
brew install gcc tcl-tk tbb gl2ps xerces-c \
libxmu libxi libxft libxpm \
glew freetype freeimage draco glfw
- name: Install rapidjson
run: |
wget https://github.com/Tencent/rapidjson/archive/858451e5b7d1c56cf8f6d58f88cf958351837e53.zip -O rapidjson.zip
unzip rapidjson.zip
- 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 CMAKE_BUILD_TYPE=Release \
-D INSTALL_DIR=${{ github.workspace }}/install \
-D 3RDPARTY_RAPIDJSON_DIR=${{ github.workspace }}/rapidjson-858451e5b7d1c56cf8f6d58f88cf958351837e53 \
-D USE_RAPIDJSON=ON \
-D USE_DRACO=ON \
-D USE_FREETYPE=ON \
-D USE_OPENGL=ON \
-D USE_FREEIMAGE=ON ..
- name: Build OCCT
run: |
cd build
make -j$(sysctl -n hw.logicalcpu)
- name: Install OCCT
run: |
cd build
make install
- name: Upload install directory
uses: actions/[email protected]
with:
name: install-macos-gcc-x64
path: install
retention-days: 7
prepare-and-build-linux-clang-x64:
name: Prepare and Build on Ubuntu with Clang (x64)
runs-on: ubuntu-24.04
steps:
- name: Checkout repository
uses: actions/[email protected]
# 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 libvtk9-dev libopenvr-dev libdraco-dev libfreeimage-dev libegl1-mesa-dev libgles2-mesa-dev libfreetype-dev
- name: Install rapidjson
run: |
wget https://github.com/Tencent/rapidjson/archive/858451e5b7d1c56cf8f6d58f88cf958351837e53.zip -O rapidjson.zip
unzip rapidjson.zip
- 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 CMAKE_BUILD_TYPE=Release \
-D INSTALL_DIR=${{ github.workspace }}/install \
-D 3RDPARTY_RAPIDJSON_DIR=${{ github.workspace }}/rapidjson-858451e5b7d1c56cf8f6d58f88cf958351837e53 \
-D USE_FREETYPE=ON \
-D USE_DRACO=ON \
-D USE_FFMPEG=OFF \
-D USE_FREEIMAGE=ON \
-D USE_GLES2=ON \
-D USE_OPENVR=ON \
-D USE_VTK=ON \
-D USE_TBB=OFF \
-D USE_RAPIDJSON=ON \
-D USE_OPENGL=ON ..
- name: Build OCCT
run: |
cd build
make -j"$(nproc)"
- name: Install OCCT
run: |
cd build
make install
- name: Upload install directory
uses: actions/[email protected]
with:
name: install-linux-clang-x64
path: install
retention-days: 7
prepare-and-build-linux-gcc-x64:
name: Prepare and Build on Ubuntu with GCC (x64)
runs-on: ubuntu-24.04
steps:
- name: Checkout repository
uses: actions/[email protected]
- 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 libvtk9-dev libopenvr-dev libdraco-dev libfreeimage-dev libegl1-mesa-dev libgles2-mesa-dev libfreetype-dev
- name: Install rapidjson
run: |
wget https://github.com/Tencent/rapidjson/archive/858451e5b7d1c56cf8f6d58f88cf958351837e53.zip -O rapidjson.zip
unzip rapidjson.zip
- 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 CMAKE_BUILD_TYPE=Release \
-D INSTALL_DIR=${{ github.workspace }}/install \
-D 3RDPARTY_RAPIDJSON_DIR=${{ github.workspace }}/rapidjson-858451e5b7d1c56cf8f6d58f88cf958351837e53 \
-D USE_FREETYPE=ON \
-D USE_DRACO=ON \
-D USE_FFMPEG=OFF \
-D USE_FREEIMAGE=ON \
-D USE_GLES2=ON \
-D USE_OPENVR=ON \
-D USE_VTK=ON \
-D USE_TBB=OFF \
-D USE_RAPIDJSON=ON \
-D USE_OPENGL=ON ..
- name: Build OCCT
run: |
cd build
make -j"$(nproc)"
- name: Install OCCT
run: |
cd build
make install
- name: Upload install directory
uses: actions/[email protected]
with:
name: install-linux-gcc-x64
path: install
retention-days: 7
test-windows-x64:
name: Test on Windows (x64)
runs-on: windows-2022
needs: prepare-and-build-windows-x64
steps:
- name: Checkout repository
uses: actions/[email protected]
- name: Set up MSVC
uses: ilammy/[email protected]
with:
arch: x64
- 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
- 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
- name: Download and extract install directory
uses: actions/[email protected]
with:
name: install-windows-x64
path: install
- 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
- name: Get latest workflow run ID from target branch
id: get_run_id
run: |
$workflow_name = "Build and Test OCCT on Multiple Platforms"
$target_branch = "${{ github.event.pull_request.base.ref }}"
Write-Host "Fetching latest run ID for workflow: $workflow_name on branch: $target_branch"
$response = Invoke-RestMethod -Uri "https://api.github.com/repos/${{ github.repository }}/actions/runs?branch=$target_branch&status=success&event=pull_request" -Headers @{Accept = "application/vnd.github.v3+json"}
$latest_run_id = ($response.workflow_runs | Where-Object { $_.name -eq $workflow_name } | Select-Object -First 1).id
Write-Host "latest_run_id=$latest_run_id" | Out-File -FilePath $env:GITHUB_ENV -Append
shell: pwsh
- name: Download test results from target branch
uses: actions/[email protected]
with:
name: results-windows-x64
path: install
github-token: ${{ secrets.GITHUB_TOKEN }}
run-id: ${{ env.latest_run_id }}
- name: Compare test results
run: |
cd install
call env.bat vc14 win64 release
for /d %%i in (results\*) do set RESULTS_SUBFOLDER=%%i
for /d %%j in (results-windows-x64\*) do set RESULTS_WINDOWS_SUBFOLDER=%%j
DRAWEXE.exe -v -c testdiff %RESULTS_SUBFOLDER% %RESULTS_WINDOWS_SUBFOLDER%
shell: cmd
- name: Upload test results
uses: actions/[email protected]
id: artifact-upload-step
with:
name: results-windows-x64
path: install/results
retention-days: 7
# Step: Upload summary.html
- name: Upload summary.html
uses: actions/[email protected]
with:
name: summary-windows-x64
path: install/results/summary.html
retention-days: 7
# Step: Upload tests.log
- name: Upload tests.log
uses: actions/[email protected]
with:
name: tests-log-windows-x64
path: install/results/tests.log
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:
- name: Checkout repository
uses: actions/[email protected]
- name: Set up MSVC
uses: ilammy/[email protected]
with:
arch: x64
- 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
- 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
- name: Download and extract install directory
uses: actions/[email protected]
with:
name: install-windows-clang-x64
path: install
- 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
- name: Get latest workflow run ID from target branch
id: get_run_id
run: |
$workflow_name = "Build and Test OCCT on Multiple Platforms"
$target_branch = "${{ github.event.pull_request.base.ref }}"
Write-Host "Fetching latest run ID for workflow: $workflow_name on branch: $target_branch"
$response = Invoke-RestMethod -Uri "https://api.github.com/repos/${{ github.repository }}/actions/runs?branch=$target_branch&status=success&event=pull_request" -Headers @{Accept = "application/vnd.github.v3+json"}
$latest_run_id = ($response.workflow_runs | Where-Object { $_.name -eq $workflow_name } | Select-Object -First 1).id
Write-Host "latest_run_id=$latest_run_id" | Out-File -FilePath $env:GITHUB_ENV -Append
shell: pwsh
- name: Download test results from target branch
uses: actions/[email protected]
with:
name: results-windows-clang-x64
path: install
github-token: ${{ secrets.GITHUB_TOKEN }}
run-id: ${{ env.latest_run_id }}
- name: Compare test results
run: |
cd install
call env.bat vc14 win64 release
for /d %%i in (results\*) do set RESULTS_SUBFOLDER=%%i
for /d %%j in (results-windows-clang-x64\*) do set RESULTS_WINDOWS_SUBFOLDER=%%j
DRAWEXE.exe -v -c testdiff %RESULTS_SUBFOLDER% %RESULTS_WINDOWS_SUBFOLDER%
shell: cmd
- name: Upload test results
uses: actions/[email protected]
id: artifact-upload-step
with:
name: results-windows-clang-x64
path: install/results
retention-days: 7
# Step: Upload summary.html
- name: Upload summary.html
uses: actions/[email protected]
with:
name: summary-windows-clang-x64
path: install/results/summary.html
retention-days: 7
# Step: Upload tests.log
- name: Upload tests.log
uses: actions/[email protected]
with:
name: tests-log-windows-clang-x64
path: install/results/tests.log
retention-days: 7
test-macos-x64:
name: Test on macOS (x64)
runs-on: macos-15
needs: prepare-and-build-macos-x64
steps:
- name: Checkout repository
uses: actions/[email protected]
- name: Install dependencies
run: |
brew update
brew install tcl-tk tbb gl2ps xerces-c \
libxmu libxi libxft libxpm \
glew freetype freeimage draco glfw
- 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
- name: Download and extract install directory
uses: actions/[email protected]
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
- name: Set execute permissions on DRAWEXE
run: chmod +x install/bin/DRAWEXE
- 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
- name: Get latest workflow run ID from target branch
id: get_run_id
run: |
workflow_name="Build and Test OCCT on Multiple Platforms"
target_branch="${{ github.event.pull_request.base.ref }}"
echo "Fetching latest run ID for workflow: $workflow_name on branch: $target_branch"
response=$(curl -s \
-H "Accept: application/vnd.github.v3+json" \
"https://api.github.com/repos/${{ github.repository }}/actions/runs?branch=$target_branch&status=success&event=pull_request")
latest_run_id=$(echo "$response" | jq -r --arg workflow_name "$workflow_name" '.workflow_runs[] | select(.name==$workflow_name) | .id' | head -n 1)
echo "latest_run_id=$latest_run_id" >> $GITHUB_ENV
- name: Download test results from target branch
uses: actions/[email protected]
with:
name: results-macos-x64
path: install/bin
github-token: ${{ secrets.GITHUB_TOKEN }}
run-id: ${{ env.latest_run_id }}
- name: Compare test results
run: |
cd install
cd bin
source env.sh
for dir in results/*; do export RESULTS_SUBFOLDER=$dir; done
for dir in results-macos-x64/*; do export RESULTS_MACOS_SUBFOLDER=$dir; done
./DRAWEXE -v -c testdiff $RESULTS_SUBFOLDER $RESULTS_MACOS_SUBFOLDER
shell: bash
- name: Upload test results
uses: actions/[email protected]
id: artifact-upload-step
with:
name: results-macos-x64
path: install/bin/results
retention-days: 7
# Step: Upload summary.html
- name: Upload summary.html
uses: actions/[email protected]
with:
name: summary-macos-x64
path: install/bin/results/summary.html
retention-days: 7
# Step: Upload tests.log
- name: Upload tests.log
uses: actions/[email protected]
with:
name: tests-log-macos-x64
path: install/bin/results/tests.log
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:
- name: Checkout repository
uses: actions/[email protected]
- name: Install dependencies
run: |
brew update
brew install tcl-tk tbb gl2ps xerces-c \
libxmu libxi libxft libxpm \
glew freetype freeimage draco glfw
- 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
- name: Download and extract install directory
uses: actions/[email protected]
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
- name: Set execute permissions on DRAWEXE
run: chmod +x install/bin/DRAWEXE
- 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
- name: Get latest workflow run ID from target branch
id: get_run_id
run: |
workflow_name="Build and Test OCCT on Multiple Platforms"
target_branch="${{ github.event.pull_request.base.ref }}"
echo "Fetching latest run ID for workflow: $workflow_name on branch: $target_branch"
response=$(curl -s \
-H "Accept: application/vnd.github.v3+json" \
"https://api.github.com/repos/${{ github.repository }}/actions/runs?branch=$target_branch&status=success&event=pull_request")
latest_run_id=$(echo "$response" | jq -r --arg workflow_name "$workflow_name" '.workflow_runs[] | select(.name==$workflow_name) | .id' | head -n 1)
echo "latest_run_id=$latest_run_id" >> $GITHUB_ENV
- name: Download test results from target branch
uses: actions/[email protected]
with:
name: results-macos-gcc-x64
path: install/bin
github-token: ${{ secrets.GITHUB_TOKEN }}
run-id: ${{ env.latest_run_id }}
- name: Compare test results
run: |
cd install
cd bin
source env.sh
for dir in results/*; do export RESULTS_SUBFOLDER=$dir; done
for dir in results-macos-gcc-x64/*; do export RESULTS_MACOS_GCC_SUBFOLDER=$dir; done
./DRAWEXE -v -c testdiff $RESULTS_SUBFOLDER $RESULTS_MACOS_GCC_SUBFOLDER
shell: bash
- name: Upload test results
uses: actions/[email protected]
id: artifact-upload-step
with:
name: results-macos-gcc-x64
path: install/bin/results
retention-days: 7
# Step: Upload summary.html
- name: Upload summary.html
uses: actions/[email protected]
with:
name: summary-macos-gcc-x64
path: install/bin/results/summary.html
retention-days: 7
# Step: Upload tests.log
- name: Upload tests.log
uses: actions/[email protected]
with:
name: tests-log-macos-gcc-x64
path: install/bin/results/tests.log
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:
- name: Checkout repository
uses: actions/[email protected]
# 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 libvtk9-dev libopenvr-dev libdraco-dev libfreeimage-dev libegl1-mesa-dev libgles2-mesa-dev libfreetype-dev
- name: Install Xvfb and Mesa
run: |
sudo apt-get update
sudo apt-get install -y xvfb mesa-utils libgl1-mesa-dri
- name: Start Xvfb
run: Xvfb :99 -screen 0 1920x1080x24 &
- name: Set DISPLAY environment variable
run: echo "DISPLAY=:99" >> $GITHUB_ENV
- 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
- name: Download and extract install directory
uses: actions/[email protected]
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
- name: Set execute permissions on DRAWEXE
run: chmod +x install/bin/DRAWEXE
- 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
- name: Get latest workflow run ID from target branch
id: get_run_id
run: |
workflow_name="Build and Test OCCT on Multiple Platforms"
target_branch="${{ github.event.pull_request.base.ref }}"
echo "Fetching latest run ID for workflow: $workflow_name on branch: $target_branch"
response=$(curl -s \
-H "Accept: application/vnd.github.v3+json" \
"https://api.github.com/repos/${{ github.repository }}/actions/runs?branch=$target_branch&status=success&event=pull_request")
latest_run_id=$(echo "$response" | jq -r --arg workflow_name "$workflow_name" '.workflow_runs[] | select(.name==$workflow_name) | .id' | head -n 1)
echo "latest_run_id=$latest_run_id" >> $GITHUB_ENV
- name: Download test results from target branch
uses: actions/[email protected]
with:
name: results-linux-clang-x64
path: install/bin
github-token: ${{ secrets.GITHUB_TOKEN }}
run-id: ${{ env.latest_run_id }}
- name: Compare test results
run: |
cd install
cd bin
source env.sh
for dir in results/*; do export RESULTS_SUBFOLDER=$dir; done
for dir in results-linux-clang-x64/*; do export RESULTS_LINUX_CLANG_SUBFOLDER=$dir; done
./DRAWEXE -v -c testdiff $RESULTS_SUBFOLDER $RESULTS_LINUX_CLANG_SUBFOLDER
shell: bash
- name: Upload test results
uses: actions/[email protected]
id: artifact-upload-step
with:
name: results-linux-clang-x64
path: install/bin/results
retention-days: 7
# Step: Upload summary.html
- name: Upload summary.html
uses: actions/[email protected]
with:
name: summary-linux-clang-x64
path: install/bin/results/summary.html
retention-days: 7
# Step: Upload tests.log
- name: Upload tests.log
uses: actions/[email protected]
with:
name: tests-log-linux-clang-x64
path: install/bin/results/tests.log
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:
- name: Checkout repository
uses: actions/[email protected]
# 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 libvtk9-dev libopenvr-dev libdraco-dev libfreeimage-dev libegl1-mesa-dev libgles2-mesa-dev libfreetype-dev
- name: Install Xvfb and Mesa
run: |
sudo apt-get update
sudo apt-get install -y xvfb mesa-utils libgl1-mesa-dri
- name: Start Xvfb
run: Xvfb :99 -screen 0 1920x1080x24 &
- name: Set DISPLAY environment variable
run: echo "DISPLAY=:99" >> $GITHUB_ENV
- 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
- name: Download and extract install directory
uses: actions/[email protected]
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
- name: Set execute permissions on DRAWEXE
run: chmod +x install/bin/DRAWEXE
- 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
- name: Get latest workflow run ID from target branch
id: get_run_id
run: |
workflow_name="Build and Test OCCT on Multiple Platforms"
target_branch="${{ github.event.pull_request.base.ref }}"
echo "Fetching latest run ID for workflow: $workflow_name on branch: $target_branch"
response=$(curl -s \
-H "Accept: application/vnd.github.v3+json" \
"https://api.github.com/repos/${{ github.repository }}/actions/runs?branch=$target_branch&status=success&event=pull_request")
latest_run_id=$(echo "$response" | jq -r --arg workflow_name "$workflow_name" '.workflow_runs[] | select(.name==$workflow_name) | .id' | head -n 1)
echo "latest_run_id=$latest_run_id" >> $GITHUB_ENV
- name: Download test results from target branch
uses: actions/[email protected]
with:
name: results-linux-gcc-x64
path: install/bin
github-token: ${{ secrets.GITHUB_TOKEN }}
run-id: ${{ env.latest_run_id }}
- name: Compare test results
run: |
cd install
cd bin
source env.sh
for dir in results/*; do export RESULTS_SUBFOLDER=$dir; done
for dir in results-linux-gcc-x64/*; do export RESULTS_LINUX_GCC_SUBFOLDER=$dir; done
./DRAWEXE -v -c testdiff $RESULTS_SUBFOLDER $RESULTS_LINUX_GCC_SUBFOLDER
shell: bash
- name: Upload test results
uses: actions/[email protected]
id: artifact-upload-step
with:
name: results-linux-gcc-x64
path: install/bin/results
retention-days: 7
# Step: Upload summary.html
- name: Upload summary.html
uses: actions/[email protected]
with:
name: summary-linux-gcc-x64
path: install/bin/results/summary.html
retention-days: 7
# Step: Upload tests.log
- name: Upload tests.log
uses: actions/[email protected]
with:
name: tests-log-linux-gcc-x64
path: install/bin/results/tests.log
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:
- name: Checkout repository
uses: actions/[email protected]
# Step: Download all test results (Windows x64) from master
- name: Download all test results (Windows x64) from master
uses: actions/[email protected]
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
run-id: ${{ env.latest_run_id }}
# Step: Download all test results (Windows Clang x64) from master
- name: Download all test results (Windows Clang x64) from master
uses: actions/[email protected]
with:
name: results-windows-clang-x64
path: results/master/windows-clang-x64
run-id: ${{ env.latest_run_id }}
# Step: Download all test results (macOS x64) from master
- name: Download all test results (macOS x64) from master
uses: actions/[email protected]
with:
name: results-macos-x64
path: results/master/macos-x64
run-id: ${{ env.latest_run_id }}
# Step: Download all test results (macOS GCC x64) from master
- name: Download all test results (macOS GCC x64) from master
uses: actions/[email protected]
with:
name: results-macos-gcc-x64
path: results/master/macos-gcc-x64
run-id: ${{ env.latest_run_id }}
# Step: Download all test results (Linux Clang x64) from master
- name: Download all test results (Linux Clang x64) from master
uses: actions/[email protected]
with:
name: results-linux-clang-x64
path: results/master/linux-clang-x64
run-id: ${{ env.latest_run_id }}
# Step: Download all test results (Linux GCC x64) from master
- name: Download all test results (Linux GCC x64) from master
uses: actions/[email protected]
with:
name: results-linux-gcc-x64
path: results/master/linux-gcc-x64
run-id: ${{ env.latest_run_id }}
# Step: Download all test results (Windows x64) from current workflow
- name: Download all test results (Windows x64)
uses: actions/[email protected]
with:
name: results-windows-x64
path: results/current/windows-x64
# Step: Download all test results (Windows Clang x64) from current workflow
- name: Download all test results (Windows Clang x64)
uses: actions/[email protected]
with:
name: results-windows-clang-x64
path: results/current/windows-clang-x64
# Step: Download all test results (macOS x64) from current workflow
- name: Download all test results (macOS x64)
uses: actions/[email protected]
with:
name: results-macos-x64
path: results/current/macos-x64
# Step: Download all test results (macOS GCC x64) from current workflow
- name: Download all test results (macOS GCC x64)
uses: actions/[email protected]
with:
name: results-macos-gcc-x64
path: results/current/macos-gcc-x64
# Step: Download all test results (Linux Clang x64) from current workflow
- name: Download all test results (Linux Clang x64)
uses: actions/[email protected]
with:
name: results-linux-clang-x64
path: results/current/linux-clang-x64
# Step: Download all test results (Linux GCC x64) from current workflow
- name: Download all test results (Linux GCC x64)
uses: actions/[email protected]
with:
name: results-linux-gcc-x64
path: results/current/linux-gcc-x64
- name: Summarize results
run: |
echo "Summarizing results..."
- name: Send PR message
run: |
echo "Sending PR message..."