-
Notifications
You must be signed in to change notification settings - Fork 6
243 lines (214 loc) · 7.84 KB
/
cmake.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
name: Build
on:
push:
branches:
- main
- develop
- 'feature/**'
- 'release/**'
pull_request:
branches:
- main
#env:
# BUILD_TYPE: Release
jobs:
build:
strategy:
matrix:
os: [ubuntu-22.04, ubuntu-24.04]
release: [Release]
ssl: [ON, OFF]
client-only: [ON, OFF]
capnp: [ON, OFF]
exclude:
- os: windows-latest
client-only: OFF
- os: ubuntu-latest
client-only: ON
- os: macos-latest
client-only: ON
runs-on: ${{ matrix.os }}
defaults:
run:
shell: bash
steps:
- uses: actions/checkout@v3
- uses: actions/github-script@v7
with:
script: |
core.exportVariable('ACTIONS_CACHE_URL', process.env.ACTIONS_CACHE_URL || '');
core.exportVariable('ACTIONS_RUNTIME_TOKEN', process.env.ACTIONS_RUNTIME_TOKEN || '');
- name: Install linux dependencies
if: matrix.os == 'ubuntu-latest'
run: >
sudo apt update && sudo apt install -y
git
libboost-dev
libboost-program-options-dev
libssl-dev
cmake
build-essential
pkg-config
libxml2-dev
libspdlog-dev
ninja-build
capnproto
libcapnp-dev
python3-dev
python3-pip
python3-venv
- name: Install Intel compiler
if: matrix.os == 'ubuntu-latest'
run: >
sudo apt install -y wget &&
wget https://apt.repos.intel.com/intel-gpg-keys/GPG-PUB-KEY-INTEL-SW-PRODUCTS.PUB &&
sudo apt-key add GPG-PUB-KEY-INTEL-SW-PRODUCTS.PUB &&
echo "deb https://apt.repos.intel.com/oneapi all main" | sudo tee /etc/apt/sources.list.d/oneAPI.list &&
sudo apt update &&
sudo apt install -y intel-basekit &&
sudo apt install -y intel-hpckit
- name: Install macos dependencies
if: matrix.os == 'macos-latest'
run: >
brew update-reset && brew install
git
boost
openssl
cmake
pkg-config
libxml2
spdlog
ninja
capnp
# - name: Cache windows packages
# id: cache-vcpkg
# uses: actions/cache@v3
# env:
# cache-name: cache-vcpkg-packages
# with:
# path: C:/vcpkg
# key: ${{ runner.os }}-build-${{ env.cache-name }}
- name: Install windows dependencies
if: matrix.os == 'windows-latest'
run: >
vcpkg install --triplet x64-mingw-static --binarysource="clear;x-gha,readwrite"
libxml2
capnproto
boost-program-options
boost-format
boost-algorithm
boost-multi-array
openssl
dlfcn-win32
spdlog
- name: Configure CMake (linux)
if: matrix.os == 'ubuntu-latest'
run: >
cmake -G Ninja -B build
-DBUILD_SHARED_LIBS=ON
-DCMAKE_BUILD_TYPE=${{ matrix.release }}
-DSSLAUTHENTICATION=${{ matrix.ssl }}
-DCLIENT_ONLY=${{ matrix.client-only }}
-DENABLE_CAPNP=${{ matrix.capnp }}
- name: Configure CMake (linux Intel)
if: matrix.os == 'ubuntu-latest'
run: >
source /opt/intel/oneapi/setvars.sh &&
CXX=icpx CC=icx cmake -G Ninja -B build-intel
-DBUILD_SHARED_LIBS=ON
-DCMAKE_BUILD_TYPE=${{ matrix.release }}
-DSSLAUTHENTICATION=${{ matrix.ssl }}
-DCLIENT_ONLY=${{ matrix.client-only }}
-DENABLE_CAPNP=${{ matrix.capnp }}
- name: Configure CMake (macos)
if: matrix.os == 'macos-latest'
run: >
cmake -G Ninja -B build
-DBUILD_SHARED_LIBS=ON
-DCMAKE_BUILD_TYPE=${{ matrix.release }}
-DSSLAUTHENTICATION=${{ matrix.ssl }}
-DCLIENT_ONLY=${{ matrix.client-only }}
-DENABLE_CAPNP=${{ matrix.capnp }}
-DOPENSSL_ROOT_DIR="$(brew --prefix openssl@3)"
- name: Configure portable XDR
if: matrix.os == 'windows-latest'
run: >
cd extlib
&& cmake -DCMAKE_TOOLCHAIN_FILE=C:/vcpkg/scripts/buildsystems/vcpkg.cmake -B build -G "MinGW Makefiles" .
- name: Build portable XDR
if: matrix.os == 'windows-latest'
run: cd extlib && cmake --build build
- name: Install portable XDR
if: matrix.os == 'windows-latest'
run: cd extlib && cmake --install build --prefix install
- name: Configure CMake (windows)
if: matrix.os == 'windows-latest'
run: >
XDR_ROOT=extlib/install cmake -G "MinGW Makefiles" -B build
-DCMAKE_TOOLCHAIN_FILE=C:/vcpkg/scripts/buildsystems/vcpkg.cmake
-DBUILD_SHARED_LIBS=ON
-DCMAKE_BUILD_TYPE=${{ matrix.release }}
-DSSLAUTHENTICATION=${{ matrix.ssl }}
-DCLIENT_ONLY=${{ matrix.client-only }}
-DENABLE_CAPNP=${{ matrix.capnp }}
-DCMAKE_INSTALL_PREFIX=${{github.workspace}}/uda_install
- name: Build
run: cmake --build build --config ${{ matrix.release }}
- name: Build Intel
if: matrix.os == 'ubuntu-latest'
run: cmake --build build-intel --config ${{ matrix.release }}
- name: Install
if: matrix.os != 'windows-latest'
run: sudo cmake --install build --config ${{ matrix.release }}
- name: Install
if: matrix.os == 'windows-latest'
run: cmake --install build --config ${{ matrix.release }}
- name: Install pyuda
if: matrix.os == 'ubuntu-latest'
run: >
cp -r /usr/local/python_installer ${{github.workspace}}/python_installer &&
python3 -m venv ${{github.workspace}}/venv &&
source ${{github.workspace}}/venv/bin/activate &&
pip3 install --upgrade pip &&
pip3 install wheel Cython "numpy<2" six &&
pip3 install ${{github.workspace}}/python_installer
- name: Test pyuda import
if: matrix.os == 'ubuntu-latest'
run: >
source ${{github.workspace}}/venv/bin/activate &&
python3 -c 'import pyuda; client=pyuda.Client()'
- name: Run non-SSL system tests
if: matrix.os == 'ubuntu-latest' && matrix.ssl == 'OFF'
run: >
sudo cp /usr/local/etc/uda.socket /usr/local/etc/uda@.service /etc/systemd/system &&
sudo systemctl start uda.socket &&
sudo systemctl enable uda.socket &&
sudo chown -R $USER:$USER /usr/local/etc &&
nc -4zv localhost 56565 &&
export UDA_HOST=localhost &&
export UDA_PORT=56565 &&
./build/test/plugins/plugin_test_testplugin
- name: Run SSL system tests
if: matrix.os == 'ubuntu-latest' && matrix.ssl == 'ON'
run: >
sudo cp /usr/local/etc/uda.socket /usr/local/etc/uda@.service /etc/systemd/system &&
sudo chown -R $USER:$USER /usr/local/etc &&
echo "export UDAHOSTNAME=github-ci-ssl" >> /usr/local/etc/udaserver.cfg &&
./scripts/create_certs.sh &&
mkdir /usr/local/etc/certs &&
cp rootCA.crt server.crt server.key /usr/local/etc/certs &&
sudo systemctl start uda.socket &&
sudo systemctl enable uda.socket &&
nc -4zv localhost 56565 &&
export UDA_HOST=localhost &&
export UDA_PORT=56565 &&
export UDA_CLIENT_SSL_AUTHENTICATE=1 &&
export UDA_CLIENT_CA_SSL_CERT=$PWD/rootCA.crt &&
export UDA_CLIENT_SSL_CERT=$PWD/client.crt &&
export UDA_CLIENT_SSL_KEY=$PWD/client.key &&
./build/test/plugins/plugin_test_testplugin
# - name: Test
# working-directory: build
# # Execute tests defined by the CMake configuration.
# # See https://cmake.org/cmake/help/latest/manual/ctest.1.html for more detail
# run: ctest -C ${{ matrix.release }}