-
Notifications
You must be signed in to change notification settings - Fork 24
329 lines (329 loc) · 17.1 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
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://sourceforge.net/projects/boost/files/boost-binaries/1.78.0//boost_1_78_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 ${{ 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
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/ftp/HDF5/releases/hdf5-1.14/hdf5-1.14.3/src/hdf5-1.14.3.zip -OutFile ${{ runner.temp }}\hdf5-1.14.3.zip
cd ${{ runner.temp }}
Expand-Archive ${{ runner.temp }}\hdf5-1.14.3.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.3
cmake --build . --config Release -j2
cmake --build . --config Release --target INSTALL
- name: Boost install
run: |
(New-Object System.Net.WebClient).DownloadFile("https://sourceforge.net/projects/boost/files/boost-binaries/1.84.0//boost_1_84_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.2.0.zip", "${{ runner.temp }}\swigwin-4.2.0.zip")
7z x ${{ runner.temp }}\swigwin-4.2.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 }}\hdf5-1.12.0-Std-win10_64-vs16\include -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.2.0/swig.exe ${{ github.workspace }}
cmake --build . --config Release -j2
cmake --build . --config Release --target INSTALL
- name: Add msbuild to PATH
uses: microsoft/[email protected]
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-java8:
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 }} # Set environment variables
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: '8'
- 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 }} -D CMAKE_C_COMPILER=${{ matrix.cc }} -D CMAKE_CXX_COMPILER=${{ matrix.cxx }}
cmake --build . -j2
cmake --install .
- name: Run java example
run: |
cd ${{ github.workspace }}/java/src
javac -cp `find ${{ github.workspace }}/../build/install -name fesapiJava*.jar` com/f2i_consulting/example/FesapiJavaExample.java
java -Djava.library.path=${{ github.workspace }}/../build/install/lib -cp `find ${{ github.workspace }}/../build/install -name fesapiJava*.jar`:. com.f2i_consulting.example.FesapiJavaExample
ubuntu-20-python3:
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v4
- name: APT install
run: |
sudo apt update
sudo apt install -y 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.14/hdf5-1.14.0/src/hdf5-1.14.0.tar.gz
tar -xzf hdf5-1.14.0.tar.gz
cd hdf5-1.14.0
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.14.0 ..
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.14.0 -DHDF5_USE_STATIC_LIBRARIES=TRUE -DCMAKE_BUILD_TYPE=Release -DWITH_PYTHON_WRAPPING=TRUE ${{ github.workspace }}
cmake --build . -j2
cmake --install .
- name: Run Python example
run: |
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:${{ github.workspace }}/../build/install/lib
pip3 install ${{ github.workspace }}/python/dist/*.whl
python3 ${{ github.workspace }}/python/example/example.py
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 ${{ github.workspace }}
cmake --build . -j2
cmake --install .
- name: Run example
run: mpiexec -n 2 ${{ runner.temp }}/build/install/example
ubuntu-20-valgrind-unitTest:
runs-on: ubuntu-20.04
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 ${{ github.workspace }}
cmake --build . -j2
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 }}