-
Notifications
You must be signed in to change notification settings - Fork 10
294 lines (252 loc) · 7.83 KB
/
headless.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
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
name: build_headless_packages
on:
push:
branch-ignore:
- '*'
tags:
- 'v?\d+.\d+.\d+-headless'
- 'headless*'
jobs:
# ------ #
# Ubuntu #
# ------ #
build-ubuntu:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-20.04, ubuntu-22.04, ubuntu-24.04]
steps:
- uses: actions/checkout@v4
name: Checkout TTK-ParaView source code
- name: Install Ubuntu dependencies
run: |
sudo apt update
# TTK-ParaView dependencies
sudo apt install -y \
g++ \
libosmesa-dev \
libopenmpi-dev \
ninja-build \
dpkg-dev
- name: Create & configure ParaView build directory
run: |
mkdir build && cd build
cmake \
-DCMAKE_BUILD_TYPE=Release \
-DCMAKE_INSTALL_PREFIX=/usr \
-DPARAVIEW_PYTHON_SITE_PACKAGES_SUFFIX=lib/python3/dist-packages \
-DPARAVIEW_USE_MPI=ON \
-DPARAVIEW_USE_QT=OFF \
-DVTK_USE_X=OFF \
-DVTK_OPENGL_HAS_OSMESA=ON \
-DTTK_PARAVIEW_HEADLESS_DEPS=ON \
-GNinja \
$GITHUB_WORKSPACE
- name: Build ParaView
run: |
cd build
cmake --build . --parallel
- name: Create ParaView package
run: |
cd build
cpack -G DEB
- name: Upload Debian package
uses: actions/upload-artifact@v4
with:
name: ttk-paraview-headless-${{ matrix.os }}
path: build/ttk-paraview.deb
# ----- #
# macOS #
# ----- #
build-macos:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [macos-13, macos-14, macos-15]
env:
CCACHE_DIR: /Users/runner/work/ttk/.ccache
CCACHE_MAXSIZE: 200M
steps:
- uses: actions/checkout@v4
name: Checkout TTK-ParaView source code
- uses: actions/setup-python@v5
with:
python-version: '3.12'
- name: Install macOS dependencies
run: |
# ParaView dependencies
brew install --cask xquartz
brew install ninja open-mpi
- name: Create & configure ParaView build directory
run: |
mkdir build && cd build
cmake \
-DCMAKE_BUILD_TYPE=Release \
-DPARAVIEW_USE_MPI=OFF \
-DPARAVIEW_USE_QT=OFF \
-GNinja \
$GITHUB_WORKSPACE
- name: Build ParaView
run: |
cd build
cmake --build . --parallel
- name: Create ParaView package
run: |
cd build
cpack -G TGZ
- name: Install ParaView
run: |
cd build
sudo cmake --build . --target install
# pvpython does not embed the correct PYTHONPATH
echo "PYTHONPATH=/usr/local/lib/python3.12/site-packages:$PYTHONPATH" >> $GITHUB_ENV
- name: Test Python imports
run: |
python3 -m vtk
python3 -m paraview.simple
pvpython -m vtk
pvpython -m paraview.simple
env:
DYLD_LIBRARY_PATH: /usr/local/lib
- name: Upload compressed binaries
uses: actions/upload-artifact@v4
with:
name: ttk-paraview-headless-${{ matrix.os }}
path: build/ttk-paraview.tar.gz
# ------- #
# Windows #
# ------- #
build-windows:
runs-on: windows-2022
env:
CONDA_ROOT: C:\Miniconda
steps:
- uses: actions/checkout@v4
name: Checkout TTK-ParaView source code
- uses: s-weigand/setup-conda@v1
- name: Install dependencies with conda
shell: bash
run: |
conda install -c conda-forge glew python=3.10
- name: Remove hosted Python
shell: bash
run: |
rm -rf C:/hostedtoolcache/windows/Python
- name: Create & configure ParaView build directory
shell: cmd
run: |
cd ..
mkdir b
cd b
cmake ^
-DPARAVIEW_USE_QT=OFF ^
-DPython3_ROOT_DIR="%CONDA_ROOT%" ^
-DCMAKE_AUTOUIC=OFF ^
-DCMAKE_BUILD_TYPE=Release ^
-DVTKm_MODULE_ENABLE_vtkm_filter_scalar_topology=NO ^
-G"Visual Studio 17 2022" ^
%GITHUB_WORKSPACE%
- name: Build ParaView
shell: cmd
run: |
cd ..\b
cmake --build . --config Release --parallel
- name: Create ParaView package
shell: bash
run: |
cd ../b
cpack -G NSIS64
mv ttk-paraview.exe $GITHUB_WORKSPACE
- name: Upload install executable
uses: actions/upload-artifact@v4
with:
name: ttk-paraview-headless-windows-2022
path: ttk-paraview.exe
# --------------------- #
# Upload release assets #
# --------------------- #
create-release:
runs-on: ubuntu-latest
needs: [build-ubuntu, build-macos, build-windows]
steps:
- name: Delete previous release
uses: actions/github-script@v6
continue-on-error: true
with:
script: |
const { owner, repo } = context.repo
const { data: { id } } = await github.rest.repos.getReleaseByTag({
owner,
repo,
tag: "${{ github.ref_name }}"
})
await github.rest.repos.deleteRelease({ owner, repo, release_id: id })
- name: Create Release
uses: actions/github-script@v6
with:
script: |
const { owner, repo } = context.repo
await github.rest.repos.createRelease({
owner,
repo,
tag_name: "${{ github.ref_name }}",
name: "Release ${{ github.ref_name }}",
draft: false,
prerelease: true
})
- name: Fetch all uploaded artifacts
uses: actions/download-artifact@v4
- name: Upload Ubuntu Focal .deb as Release Asset
uses: svenstaro/upload-release-action@v2
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
tag: ${{ github.ref }}
file: ttk-paraview-headless-ubuntu-20.04/ttk-paraview.deb
asset_name: ttk-paraview-headless-ubuntu-20.04.deb
- name: Upload Ubuntu Jammy .deb as Release Asset
uses: svenstaro/upload-release-action@v2
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
tag: ${{ github.ref }}
file: ttk-paraview-headless-ubuntu-22.04/ttk-paraview.deb
asset_name: ttk-paraview-headless-ubuntu-22.04.deb
- name: Upload Ubuntu Noble Numbat .deb as Release Asset
uses: svenstaro/upload-release-action@v2
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
tag: ${{ github.ref }}
file: ttk-paraview-headless-ubuntu-24.04/ttk-paraview.deb
asset_name: ttk-paraview-headless-ubuntu-24.04.deb
- name: Upload MacOS 15 .tar.gz as Release Asset
uses: svenstaro/upload-release-action@v2
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
tag: ${{ github.ref }}
file: ttk-paraview-headless-macos-15/ttk-paraview.tar.gz
asset_name: ttk-paraview-headless-macos-15.tar.gz
- name: Upload MacOS 14 .tar.gz as Release Asset
uses: svenstaro/upload-release-action@v2
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
tag: ${{ github.ref }}
file: ttk-paraview-headless-macos-14/ttk-paraview.tar.gz
asset_name: ttk-paraview-headless-macos-14.tar.gz
- name: Upload MacOS 13 .tar.gz as Release Asset
uses: svenstaro/upload-release-action@v2
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
tag: ${{ github.ref }}
file: ttk-paraview-headless-macos-13/ttk-paraview.tar.gz
asset_name: ttk-paraview-headless-macos-13.tar.gz
- name: Upload .exe as Release Asset
uses: svenstaro/upload-release-action@v2
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
tag: ${{ github.ref }}
file: ttk-paraview-headless-windows-2022/ttk-paraview.exe
asset_name: ttk-paraview-headless.exe
- name: Delete package artifacts
uses: geekyeggo/delete-artifact@v2
with:
name: |
ttk-paraview-headless*