-
Notifications
You must be signed in to change notification settings - Fork 24
395 lines (395 loc) · 21 KB
/
github-actions.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
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
name: github-actions
on: [push, pull_request]
jobs:
windows-2019-dynamicLink:
runs-on: windows-2019
steps:
- uses: actions/checkout@v4
- name: HDF5 install
run: |
Invoke-WebRequest https://support.hdfgroup.org/ftp/HDF5/releases/hdf5-1.12/hdf5-1.12.0/bin/hdf5-1.12.0-Std-win10_64-vs16.zip -OutFile ${{ runner.temp }}\hdf5-1.12.0-Std-win10_64-vs16.zip
Expand-Archive ${{ runner.temp }}\hdf5-1.12.0-Std-win10_64-vs16.zip -DestinationPath ${{ runner.temp }}
msiexec.exe /i "${{ runner.temp }}\hdf\HDF5-1.12.0-win64.msi" /qn INSTALL_ROOT=${{ runner.temp }}\hdf5-1.12.0-Std-win10_64-vs16
- name: Minizip DLL install
run: |
git clone https://github.com/F2I-Consulting/Minizip.git ${{ runner.temp }}/Minizip
cd ${{ runner.temp }}
mkdir minizip-build
cd minizip-build
cmake -G"Visual Studio 16 2019" -A x64 -T host=x64 -Wno-dev -Wno-deprecated -DZLIB_ROOT=${{ runner.temp }}/hdf5-1.12.0-Std-win10_64-vs16 -DCMAKE_INSTALL_PREFIX=${{ runner.temp }}/minizip-install ${{ runner.temp }}/Minizip
cmake --build . --config Release -j2
cmake --build . --config Release --target INSTALL
- name: Boost install
run: |
(New-Object System.Net.WebClient).DownloadFile("https://boostorg.jfrog.io/artifactory/main/release/1.86.0/binaries/boost_1_86_0-msvc-14.2-64.exe", "${{ runner.temp }}\boost.exe")
Start-Process -Wait -FilePath "${{ runner.temp }}\boost.exe" "/SILENT","/SP-","/SUPPRESSMSGBOXES","/DIR=${{ runner.temp }}\boost-install"
- name: CMake build and install
run: |
cd ${{ github.workspace }}/..
mkdir build
cd build
cmake -G"Visual Studio 16 2019" -A x64 -T host=x64 -Wno-dev -Wno-deprecated -DHDF5_ROOT=${{ runner.temp }}\hdf5-1.12.0-Std-win10_64-vs16 -DMINIZIP_ROOT=${{ runner.temp }}/minizip-install -DZLIB_ROOT=${{ runner.temp }}\hdf5-1.12.0-Std-win10_64-vs16 -DSZIP_LIBRARY_RELEASE=${{ runner.temp }}\hdf5-1.12.0-Std-win10_64-vs16/lib/szip.lib -DBoost_INCLUDE_DIR=${{ runner.temp }}\boost-install -DWITH_EXAMPLE=TRUE -DWITH_RESQML2_2=TRUE -DWITH_TEST=TRUE -DCMAKE_INSTALL_PREFIX=${{ runner.temp }}/fesapi-install ${{ github.workspace }}
cmake --build . --config Release -j2
cmake --build . --config Release --target INSTALL
- name: Copy hdf5 dll
run: |
Copy-Item ${{ runner.temp }}\hdf5-1.12.0-Std-win10_64-vs16\bin\hdf5.dll -Destination ${{ github.workspace }}\..\build\Release
Copy-Item ${{ runner.temp }}\hdf5-1.12.0-Std-win10_64-vs16\bin\zlib.dll -Destination ${{ github.workspace }}\..\build\Release
- name: Run Unit tests
run: |
${{ github.workspace }}\..\build\Release\unitTest
- name: Run Cpp example
run: |
${{ github.workspace }}\..\build\Release\example.exe
- uses: actions/upload-artifact@v4
with:
name: windows-2019
path: ${{ runner.temp }}/fesapi-install
windows-2019-staticLink-cs:
runs-on: windows-2019
steps:
- uses: actions/checkout@v4
- name: zlib install
run: |
Invoke-WebRequest https://zlib.net/current/zlib.tar.gz -OutFile ${{ runner.temp }}\zlib.tar.gz
cd ${{ runner.temp }}
tar -xzf ${{ runner.temp }}\zlib.tar.gz
mkdir zlib-build
cd zlib-build
cmake -G"Visual Studio 16 2019" -A x64 -T host=x64 -Wno-dev -Wno-deprecated -DCMAKE_INSTALL_PREFIX=${{ runner.temp }}/zlib-install ${{ runner.temp }}/zlib-1.3.1
cmake --build . --config Release -j2
cmake --build . --config Release --target INSTALL
- name: Minizip static lib install
run: |
git clone https://github.com/F2I-Consulting/Minizip.git ${{ runner.temp }}/Minizip
cd ${{ runner.temp }}
mkdir minizip-build
cd minizip-build
cmake -G"Visual Studio 16 2019" -A x64 -T host=x64 -Wno-dev -Wno-deprecated -DBUILD_SHARED_LIBS=FALSE -DZLIB_ROOT=${{ runner.temp }}/zlib-install -DZLIB_USE_STATIC_LIBS=TRUE -DCMAKE_INSTALL_PREFIX=${{ runner.temp }}/minizip-install ${{ runner.temp }}/Minizip
cmake --build . --config Release -j2
cmake --build . --config Release --target INSTALL
- name: HDF5 install
run: |
Invoke-WebRequest https://support.hdfgroup.org/releases/hdf5/v1_14/v1_14_5/downloads/hdf5-1.14.5.zip -OutFile ${{ runner.temp }}\hdf5-1.14.5.zip
cd ${{ runner.temp }}
Expand-Archive ${{ runner.temp }}\hdf5-1.14.5.zip -DestinationPath ${{ runner.temp }}
mkdir hdf5-build
cd hdf5-build
cmake -G"Visual Studio 16 2019" -A x64 -T host=x64 -Wno-dev -Wno-deprecated -DHDF5_ENABLE_Z_LIB_SUPPORT:BOOL=ON -DZLIB_INCLUDE_DIR:PATH=${{ runner.temp }}/zlib-install/include -DZLIB_LIBRARY:PATH=${{ runner.temp }}/zlib-install/lib/zlibstatic.lib -DHDF5_BUILD_FORTRAN:BOOL=OFF -DHDF5_BUILD_JAVA:BOOL=OFF -DHDF5_ENABLE_PARALLEL:BOOL=OFF -DHDF5_BUILD_CPP_LIB:BOOL=OFF -DHDF5_BUILD_HL_LIB:BOOL=OFF -DHDF5_BUILD_EXAMPLES:BOOL=OFF -DHDF5_BUILD_GENERATORS:BOOL=OFF -DHDF5_BUILD_TOOLS:BOOL=OFF -DHDF5_BUILD_UTILS:BOOL=OFF -DBUILD_TESTING:BOOL=OFF -DCMAKE_INSTALL_PREFIX=${{ runner.temp }}/hdf5-install ${{ runner.temp }}/hdf5-1.14.5
cmake --build . --config Release -j2
cmake --build . --config Release --target INSTALL
- name: Boost install
run: |
(New-Object System.Net.WebClient).DownloadFile("https://boostorg.jfrog.io/artifactory/main/release/1.86.0/binaries/boost_1_86_0-msvc-14.2-64.exe", "${{ runner.temp }}\boost.exe")
Start-Process -Wait -FilePath "${{ runner.temp }}\boost.exe" "/SILENT","/SP-","/SUPPRESSMSGBOXES","/DIR=${{ runner.temp }}\boost-install"
- name: Swig install
run: |
(New-Object System.Net.WebClient).DownloadFile("http://prdownloads.sourceforge.net/swig/swigwin-4.3.0.zip", "${{ runner.temp }}\swigwin-4.3.0.zip")
7z x ${{ runner.temp }}\swigwin-4.3.0.zip -o${{ runner.temp }}
- name: CMake build and install
run: |
cd ${{ github.workspace }}/..
mkdir build
cd build
cmake -G"Visual Studio 16 2019" -A x64 -T host=x64 -Wno-dev -Wno-deprecated -DHDF5_ROOT=${{ runner.temp }}/hdf5-install -DHDF5_USE_STATIC_LIBRARIES=TRUE -DMINIZIP_ROOT=${{ runner.temp }}/minizip-install -DZLIB_ROOT=${{ runner.temp }}/zlib-install -DZLIB_USE_STATIC_LIBS=TRUE -DBoost_INCLUDE_DIR=${{ runner.temp }}/boost-install -DWITH_EXAMPLE=TRUE -DWITH_RESQML2_2=TRUE -DWITH_DOTNET_WRAPPING=TRUE -DSWIG_EXECUTABLE=${{ runner.temp }}/swigwin-4.3.0/swig.exe -DCMAKE_INSTALL_PREFIX=${{ runner.temp }}/fesapi-install ${{ github.workspace }}
cmake --build . --config Release -j2
cmake --build . --config Release --target INSTALL
- name: Add msbuild to PATH
uses: microsoft/setup-msbuild@v2
with:
msbuild-architecture: x64
- name: Build the C# example
run: msbuild ${{ github.workspace }}/cs/example/example.sln -t:rebuild /p:Configuration=Release /p:Platform="x64"
- name: Run Cpp example
run: |
${{ github.workspace }}\..\build\Release\example.exe
- name: Copy all dlls for C#
run: |
Copy-Item ${{ github.workspace }}\..\build\Release\*.dll -Destination ${{ github.workspace }}\cs\example\bin\x64\Release
- name: Run C# example
run: |
${{ github.workspace }}\cs\example\bin\x64\Release\example.exe
ubuntu-20-java11:
runs-on: ubuntu-20.04
strategy:
fail-fast: false # 'false' means Don't stop matrix workflows even if some matrix failed.
matrix:
include: [
{ xcc_name: 'gcc 9', xcc_pkg: gcc-9, cc: gcc-9, cxx: g++-9 },
{ xcc_name: 'gcc 10', xcc_pkg: gcc-10, cc: gcc-10, cxx: g++-10 },
{ xcc_name: 'clang 9', xcc_pkg: clang-9, cc: clang-9, cxx: clang++-9 },
{ xcc_name: 'clang 10', xcc_pkg: clang-10, cc: clang-10, cxx: clang++-10 },
{ xcc_name: 'clang 11', xcc_pkg: clang-11, cc: clang-11, cxx: clang++-11 },
# { xcc_name: 'clang 12', xcc_pkg: clang-12, cc: clang, cxx: clang++ },
]
env:
XCC: $${{ matrix.xcc_name }}
CC: ${{ matrix.cc }}
CXX: ${{ matrix.cxx }}
steps:
- uses: actions/checkout@v4
- uses: actions/setup-java@v4
with:
distribution: 'temurin' # See 'Supported distributions' for available options
java-version: '11'
- name: APT install
run: |
sudo apt update
sudo apt install -y ${{ matrix.xcc_pkg }} libminizip-dev libboost-all-dev
# Build HDF5 instead of downloading the package because the package is not built with -fPIC causing relocation issue.
- name: HDF5 build and install
run: |
cd ${{ runner.temp }}
wget https://support.hdfgroup.org/ftp/HDF5/releases/hdf5-1.12/hdf5-1.12.2/src/hdf5-1.12.2.tar.gz
tar -xzf hdf5-1.12.2.tar.gz
cd hdf5-1.12.2
mkdir build
cd build
cmake -G "Unix Makefiles" -DCMAKE_BUILD_TYPE:STRING=Release -DBUILD_SHARED_LIBS:BOOL=OFF -DBUILD_TESTING:BOOL=OFF -DHDF5_BUILD_TOOLS:BOOL=OFF -DHDF5_BUILD_EXAMPLES:BOOL=OFF -DHDF5_BUILD_CPP_LIB:BOOL=OFF -DHDF5_BUILD_HL_LIB:BOOL=OFF -DHDF5_ENABLE_Z_LIB_SUPPORT:BOOL=ON -DCMAKE_INSTALL_PREFIX:STRING=${{ runner.temp }}/install-hdf5-1.12.2 ..
cmake --build . --config Release
make -j4
make install
- name: CMake build and install
run: |
cd ..
mkdir build
cd build
cmake -DHDF5_ROOT=${{ runner.temp }}/install-hdf5-1.12.2 -DHDF5_USE_STATIC_LIBRARIES=TRUE -DCMAKE_BUILD_TYPE=Release -DWITH_JAVA_WRAPPING=TRUE ${{ github.workspace }} -DCMAKE_C_COMPILER=${{ matrix.cc }} -DCMAKE_CXX_COMPILER=${{ matrix.cxx }} -DCMAKE_INSTALL_PREFIX=${{ runner.temp }}/fesapi-install
cmake --build . -j2
cmake --install .
- name: Run java example
run: |
cd ${{ github.workspace }}/java/src
javac -cp `find ${{ runner.temp }}/fesapi-install -name fesapiJava*.jar` com/f2i_consulting/example/FesapiJavaExample.java
java -Djava.library.path=${{ runner.temp }}/fesapi-install/lib -cp `find ${{ runner.temp }}/fesapi-install -name fesapiJava*.jar`:. com.f2i_consulting.example.FesapiJavaExample
- uses: actions/upload-artifact@v4
with:
name: ubuntu-20.04-${{ matrix.cxx }}
path: ${{ runner.temp }}/fesapi-install
build_wheels_linux:
name: Build wheels on ubuntu-latest
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Stub `setup.py` check
# It will be generated during CMake run
# https://github.com/pypa/cibuildwheel/issues/1139
run: touch python/setup.py
- name: Build wheels
uses: pypa/cibuildwheel@v2.19.2
env:
CIBW_BUILD: cp38-manylinux_* cp39-manylinux_* cp310-manylinux_* cp311-manylinux_* cp312-manylinux_* cp313-manylinux_*
CIBW_ARCHS: auto64
CIBW_BEFORE_ALL: >
yum install -y wget minizip-devel gcc-c++ boost-devel &&
yum search epel-release &&
yum info epel-release &&
yum install -y epel-release &&
yum --enablerepo=epel install -y cmake3 &&
cd / &&
wget https://support.hdfgroup.org/ftp/HDF5/releases/hdf5-1.12/hdf5-1.12.3/src/hdf5-1.12.3.tar.gz &&
tar xf hdf5-1.12.3.tar.gz &&
mkdir hdf5-build &&
cd hdf5-build &&
cmake3 -G "Unix Makefiles" -DCMAKE_BUILD_TYPE:STRING=Release -DCMAKE_POSITION_INDEPENDENT_CODE=ON -DBUILD_SHARED_LIBS:BOOL=OFF -DBUILD_TESTING:BOOL=OFF -DHDF5_BUILD_TOOLS:BOOL=OFF -DHDF5_BUILD_EXAMPLES:BOOL=OFF -DHDF5_BUILD_CPP_LIB:BOOL=OFF -DHDF5_BUILD_HL_LIB:BOOL=OFF -DCMAKE_INSTALL_PREFIX:STRING=/hdf5-install ../hdf5-1.12.3 &&
cmake3 --build . -j2 --config Release &&
cmake3 --install . &&
cd / &&
mkdir build &&
cd build &&
cmake3 -DCMAKE_BUILD_TYPE=Release -DHDF5_ROOT=/hdf5-install -DHDF5_USE_STATIC_LIBRARIES=TRUE -DWITH_PYTHON_WRAPPING=TRUE -DCMAKE_INSTALL_PREFIX:STRING=/fesapi-install {project} &&
cmake3 --build . -j2 --config Release &&
cmake3 --install .
CIBW_REPAIR_WHEEL_COMMAND_LINUX: >
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/fesapi-install/lib64 &&
auditwheel repair -w {dest_dir} {wheel}
CIBW_TEST_COMMAND: python {project}/python/example/example.py
with:
package-dir: ./python
output-dir: wheelhouse
- uses: actions/upload-artifact@v4
with:
name: cibw-wheels-ubuntu-latest
path: ./wheelhouse/*.whl
build_wheels_mac:
name: Build wheels on macos-14
runs-on: macos-14
steps:
- uses: actions/checkout@v4
- name: Stub `setup.py` check
# It will be generated during CMake run
# https://github.com/pypa/cibuildwheel/issues/1139
run: touch python/setup.py
- name: Build wheels
uses: pypa/cibuildwheel@v2.19.2
env:
CIBW_BUILD: cp38-macosx_* cp39-macosx_* cp310-macosx_* cp311-macosx_* cp312-macosx_* cp313-macosx_*
CIBW_ARCHS: auto64
CIBW_BEFORE_ALL: >
brew install boost swig &&
git clone https://github.com/F2I-Consulting/Minizip.git ${{ github.workspace }}/../minizip &&
cd ${{ github.workspace }}/.. &&
mkdir minizip-build &&
cd minizip-build &&
cmake -G "Unix Makefiles" -DCMAKE_BUILD_TYPE:STRING=Release -DCMAKE_POSITION_INDEPENDENT_CODE=ON -DCMAKE_INSTALL_PREFIX=${{ github.workspace }}/../minizip-install ${{ github.workspace }}/../minizip &&
cmake --build . -j2 --config Release &&
cmake --install . &&
cd ${{ github.workspace }}/.. &&
wget https://github.com/HDFGroup/hdf5/releases/download/hdf5_1.14.5/hdf5-1.14.5.tar.gz &&
tar xf hdf5-1.14.5.tar.gz &&
mkdir hdf5-build &&
cd hdf5-build &&
cmake -G "Unix Makefiles" -DCMAKE_BUILD_TYPE:STRING=Release -DCMAKE_POSITION_INDEPENDENT_CODE=ON -DBUILD_SHARED_LIBS:BOOL=OFF -DBUILD_TESTING:BOOL=OFF -DHDF5_BUILD_TOOLS:BOOL=OFF -DHDF5_BUILD_EXAMPLES:BOOL=OFF -DHDF5_BUILD_CPP_LIB:BOOL=OFF -DHDF5_BUILD_HL_LIB:BOOL=OFF -DCMAKE_INSTALL_PREFIX:STRING=${{ github.workspace }}/../hdf5-install ../hdf5-1.14.5 &&
cmake --build . -j2 --config Release &&
cmake --install . &&
mkdir ${{ github.workspace }}/../build &&
cd ${{ github.workspace }}/../build &&
cmake -DCMAKE_BUILD_TYPE=Release -DMINIZIP_ROOT=${{ github.workspace }}/../minizip-install -DHDF5_ROOT=${{ github.workspace }}/../hdf5-install -DHDF5_USE_STATIC_LIBRARIES=TRUE -DWITH_PYTHON_WRAPPING=TRUE -DCMAKE_INSTALL_PREFIX:STRING=${{ github.workspace }}/../fesapi-install ${{ github.workspace }} &&
cmake --build . -j2 --config Release &&
cmake --install .
# See https://cibuildwheel.pypa.io/en/stable/faq/#macos-passing-dyld_library_path-to-delocate
CIBW_REPAIR_WHEEL_COMMAND_MACOS: >
DYLD_LIBRARY_PATH=${{ github.workspace }}/../fesapi-install/lib delocate-wheel --require-archs {delocate_archs} -w {dest_dir} {wheel}
CIBW_TEST_COMMAND: python ${{ github.workspace }}/python/example/example.py
with:
package-dir: ./python
output-dir: wheelhouse
- uses: actions/upload-artifact@v4
with:
name: cibw-wheels-macos-14
path: ./wheelhouse/*.whl
ubuntu-20-mpi:
runs-on: ubuntu-20.04
steps:
- name: Checkout
uses: actions/checkout@v4
- name: APT install
run: |
sudo apt update
sudo apt install -y libhdf5-mpi-dev libminizip-dev libboost-all-dev
- name: Setup MPI
uses: mpi4py/setup-mpi@v1
- name: CMake build and install
run: |
cd ${{ runner.temp }}
mkdir build
cd build
cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_CXX_COMPILER=mpic++ -DCMAKE_C_COMPILER=mpicc -DHDF5_PREFER_PARALLEL:BOOL=TRUE -DWITH_EXAMPLE:BOOL=TRUE -DCMAKE_INSTALL_PREFIX=${{ runner.temp }}/fesapi-install ${{ github.workspace }}
cmake --build . -j2
cmake --install .
- name: Run example
run: mpiexec -n 2 ${{ runner.temp }}/fesapi-install/example
ubuntu-latest-valgrind-unitTest:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: APT install
run: |
sudo apt update
sudo apt install -y libhdf5-dev libminizip-dev libboost-all-dev valgrind
- name: CMake build and install
run: |
cd ..
mkdir build
cd build
cmake -DCMAKE_BUILD_TYPE=Debug -DWITH_EXAMPLE=TRUE -DWITH_RESQML2_2=TRUE -DWITH_TEST=TRUE -DCMAKE_INSTALL_PREFIX=${{ runner.temp }}/fesapi-install ${{ github.workspace }}
cmake --build . -j2 --config Debug
cmake --install .
- name: Run Valgrind on example
run: |
valgrind --leak-check=full --track-origins=yes --show-leak-kinds=all ${{ github.workspace }}/../build/example/exampled
- name: Run Unit tests
run: |
${{ github.workspace }}/../build/test/unitTest
webassembly:
if: false
runs-on: ubuntu-20.04
steps:
- uses: mymindstorm/setup-emsdk@v11
- uses: actions/checkout@v4
- name: Verify
run: emcc -v
- name: "Set environmental variables"
run: |
echo "WASM_INSTALL_DIR=${{ github.workspace }}/install" >> $GITHUB_ENV
echo "WASM_LIB_DIR=${{ github.workspace }}/install/lib" >> $GITHUB_ENV
echo "WASM_INCLUDE_DIR=${{ github.workspace }}/install/include" >> $GITHUB_ENV
- name: HDF5 install
env:
HDF5_DOWNLOAD_URL: https://github.com/HDFGroup/hdf5/archive/refs/tags/hdf5-1_12_1.tar.gz
run: |
wget ${{ env.HDF5_DOWNLOAD_URL }} -O hdf5_src.tgz
tar -xvzf hdf5_src.tgz
mkdir -p hdf5_build
cd hdf5_build
LDFLAGS="-s NODERAWFS=1 -s USE_ZLIB=1" emcmake cmake ../hdf5-hdf5-1_12_1 \
-DCMAKE_BUILD_TYPE=Release \
-DCMAKE_INSTALL_PREFIX=${{ env.WASM_INSTALL_DIR }} \
-DH5_HAVE_GETPWUID=0 \
-DH5_HAVE_SIGNAL=0 \
-DBUILD_SHARED_LIBS=0 \
-DBUILD_STATIC_LIBS=1 \
-DBUILD_TESTING=0 \
-DHDF5_BUILD_EXAMPLES=0 \
-DHDF5_BUILD_TOOLS=0 \
-DHDF5_ENABLE_Z_LIB_SUPPORT=1
emmake make -j8 install
- name: Minizip install
run: |
git clone https://github.com/F2I-Consulting/Minizip.git
mkdir -p minizip_build
cd minizip_build
LDFLAGS="-s USE_ZLIB=1" emcmake cmake ../Minizip \
-DCMAKE_INSTALL_PREFIX=${{ env.WASM_INSTALL_DIR }}
emmake make -j8 install
- name: CMake build
env:
FESAPI_BUILD_DIR: fesapi_build
run: |
cd ${{ github.workspace }}
# see https://sourceforge.net/p/gsoap2/bugs/1301/
#wget https://gist.github.com/untereiner/3af2e52fbd135235457d2a707d5480d4/raw/7f7e0706b3421593c4c617b9703e5a90e30bfa51/gsoap_wasm.patch
#git apply gsoap_wasm.patch
mkdir -p fesapi_build
cd fesapi_build
LDFLAGS="-s USE_ZLIB=1 -s USE_BOOST_HEADERS=1" emcmake cmake ../ \
-DCMAKE_BUILD_TYPE=Release \
-DCMAKE_INSTALL_PREFIX=${{ env.WASM_INSTALL_DIR }} \
-DWITH_LOCAL_HDF5=ON \
-DHDF5_INCLUDE_DIRS=${{ env.WASM_INCLUDE_DIR }} \
-DHDF5_LIBRARIES=${{ env.WASM_LIB_DIR }}/libhdf5.a \
-DMINIZIP_INCLUDE_DIR=${{ env.WASM_INCLUDE_DIR }} \
-DMINIZIP_LIBRARY_RELEASE=${{ env.WASM_LIB_DIR }}/libminizip.a \
-DWITH_EXAMPLE=0 \
-DWITH_RESQML2_2=1 \
-DWITH_TEST=0 \
-DWITH_WASM_WRAPPING=1
emmake make -j8 fesapi-wasm
emmake make -j8 fesapi-wasm-node
- name: 'Upload Artifact'
uses: actions/upload-artifact@v3
with:
name: fesapi-mjs
path: |
${{ github.workspace }}/webassembly/dist/esm/fesapi.mjs
${{ github.workspace }}/webassembly/dist/esm/fesapi.wasm
# Setup .npmrc file to publish to npm
#- name: 'Setup node'
# uses: actions/setup-node@v3
# with:
# node-version: '16.x'
# registry-url: 'https://registry.npmjs.org'
# cache-dependency-path: ${{ github.workspace }}/webassembly/package-lock.json
#- name: Configure NPM
# working-directory: ${{ github.workspace }}/webassembly/
# run: |
# echo "//npm.pkg.github.com/:_authToken=\${NODE_AUTH_TOKEN}" >> .npmrc
# echo "always-auth: true" >> .npmrc
# env:
# NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
#- run: npm ci
# working-directory: ${{ github.workspace }}/webassembly/
#- run: npm publish --access public
# working-directory: ${{ github.workspace }}/webassembly/
# env:
# NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}