forked from Open-Cascade-SAS/OCCT
-
Notifications
You must be signed in to change notification settings - Fork 0
143 lines (117 loc) · 4.82 KB
/
build-and-test-multiplatform.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
# 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:
- '**'
push:
branches:
- 'master'
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number }}
cancel-in-progress: true
jobs:
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/checkout@v4.1.7
- name: Install dependencies
run: sudo apt-get update && sudo apt-get install -y tcl-dev tk-dev cmake clang 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 mesa-utils libgl1-mesa-dev libxext-dev libxrandr-dev vulkan-tools libvulkan-dev xvfb mesa-utils libgl1-mesa-dri xkb-data
- name: Install dependencies
run: sudo apt-get update && sudo apt-get install -y xserver-xorg-video-dummy ninja-build
- name: Install clang
run: |
wget https://apt.llvm.org/llvm.sh
chmod +x llvm.sh
sudo ./llvm.sh 20
- name: Start Xvfb
run: Xvfb :99 -screen 0 1920x1080x24 &
- 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 "Ninja" \
-D CMAKE_C_COMPILER=clang-20 \
-D CMAKE_CXX_COMPILER=clang++-20 \
-D BUILD_USE_PCH=ON \
-D BUILD_INCLUDE_SYMLINK=ON \
-D USE_TK=ON \
-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_XLIB=ON \
-D USE_OPENVR=ON \
-D USE_VTK=ON \
-D USE_TBB=OFF \
-D USE_RAPIDJSON=ON \
-D USE_OPENGL=ON ..
- name: Install OCCT
run: |
cd build
cmake --build . --target install --config Release
- name: Upload install directory
uses: actions/upload-artifact@v4.4.3
with:
name: install-linux-clang-x64
path: install
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/checkout@v4.1.7
- name: Install dependencies
run: sudo apt-get update && sudo apt-get install -y tcl-dev tk-dev cmake clang 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 mesa-utils libgl1-mesa-dev libxext-dev libxrandr-dev vulkan-tools libvulkan-dev xvfb mesa-utils libgl1-mesa-dri xkb-data
- name: Install dependencies
run: sudo apt-get update && sudo apt-get install -y xserver-xorg-video-dummy
- 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/download-artifact@v4.1.7
with:
name: install-linux-clang-x64
path: install
- 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 caf presentation
shell: bash
env:
DISPLAY: :99
LIBGL_ALWAYS_SOFTWARE: 1
CSF_TestScriptsPath: ${{ github.workspace }}/tests
CSF_TestDataPath: ${{ github.workspace }}/data
- 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: 15