forked from open-quantum-safe/oqs-provider
-
Notifications
You must be signed in to change notification settings - Fork 1
305 lines (299 loc) · 11.1 KB
/
windows.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
name: Windows tests
on: [pull_request, push]
permissions:
contents: read
jobs:
cygwin:
# Run a job for each of the specified target architectures:
strategy:
matrix:
os:
- windows-2019
# - windows-2022
platform:
- arch: win64
oqsconfig: -DOQS_ALGS_ENABLED=STD
# - arch: win32
# config: --strict-warnings no-fips enable-quic
runs-on: ${{matrix.os}}
env:
CYGWIN_NOWINPATH: 1
SHELLOPTS: igncr
# Don't overwhelm github CI VMs:
MAKE_PARAMS: -j 4
steps:
- name: Checkout provider
uses: actions/checkout@v3
- name: Checkout openssl
uses: actions/checkout@v3
with:
set-safe-directory: true
repository: openssl/openssl
path: openssl
- name: checkout liboqs
uses: actions/checkout@v3
with:
set-safe-directory: true
repository: open-quantum-safe/liboqs
ref: main
path: liboqs
- name: Install cygwin
uses: cygwin/cygwin-install-action@master
with:
packages: perl git ninja gcc-core cmake make
- name: Retrieve OpenSSL32 from cache
id: cache-openssl32
uses: actions/cache@v3
with:
path: c:\cygwin\opt\openssl32
key: ${{ runner.os }}-cygwinopenssl32
- name: Set installpath
run: |
echo "IP=$(cygpath -u $PWD)/.local" >> "$env:GITHUB_ENV"
- name: build liboqs
run: |
which cmake
cmake --version
gcc --version
mkdir _build
cd _build
cmake -GNinja -DOPENSSL_ROOT_DIR=/opt/openssl32 -DCMAKE_INSTALL_PREFIX="${{ env.IP }}" ${{ matrix.platform.oqsconfig }} -DCMAKE_C_COMPILER=gcc ..
ninja
ninja install
working-directory: liboqs
- name: Build openssl3 if not cached
if: steps.cache-openssl32.outputs.cache-hit != 'true'
run: bash -c "./config --prefix=/opt/openssl32 ${{ matrix.platform.config }} && perl configdata.pm --dump && make $MAKE_PARAMS && make install_sw"
working-directory: openssl
- name: Check OpenSSL install3
run: dir c:\cygwin\opt\openssl32
- name: Save OpenSSL
id: cache-openssl-save
if: steps.cache-openssl32.outputs.cache-hit != 'true'
uses: actions/cache/save@v3
with:
path: |
c:\cygwin\opt\openssl32
key: ${{ runner.os }}-cygwinopenssl32
- name: build oqs-provider
run: bash -c "git config --global --add safe.directory $(cygpath -u $PWD) && liboqs_DIR='${{ env.IP }}' cmake -GNinja -DCMAKE_C_COMPILER=gcc -DOPENSSL_ROOT_DIR=/opt/openssl32 -S . -B _build && cd _build && ninja && cd .."
- name: Check Openssl providers
run: bash -c "OPENSSL_MODULES=_build/lib /opt/openssl32/bin/openssl list -providers -provider oqsprovider -provider default"
- name: Run tests
run: bash -c "echo $PATH && PATH=/opt/openssl32/bin:/usr/bin ctest -V"
working-directory: _build
- name: Retain oqsprovider.dll
uses: actions/upload-artifact@v3
with:
name: oqs-provider-cygwin
path: D:/a/oqs-provider/oqs-provider/_build/bin/oqsprovider.dll
msvc:
# Run a job for each of the specified target architectures:
strategy:
matrix:
os:
- windows-2019
# - windows-2022
platform:
- arch: win64
oqsconfig: -DOQS_ALGS_ENABLED=STD
osslconfig: no-shared no-fips VC-WIN64A-masm
# - arch: win32
# oqsconfig: -DOQS_ALGS_ENABLED=STD
# osslconfig: --strict-warnings no-fips enable-quic
runs-on: ${{matrix.os}}
steps:
- name: Restore OpenSSL32 cache
id: cache-openssl32
uses: actions/cache@v3
with:
path: c:\openssl32
key: ${{ runner.os }}-msvcopenssl32
- uses: actions/checkout@v3
- name: Checkout OpenSSL master
if: steps.cache-openssl32.outputs.cache-hit != 'true'
uses: actions/checkout@v3
with:
set-safe-directory: true
repository: openssl/openssl
path: openssl
- uses: actions/checkout@v3
with:
set-safe-directory: true
repository: open-quantum-safe/liboqs
path: liboqs
- uses: ilammy/msvc-dev-cmd@v1
with:
arch: ${{ matrix.platform.arch }}
- name: Setup nasm for OpenSSL build
uses: ilammy/setup-nasm@v1
if: steps.cache-openssl32.outputs.cache-hit != 'true'
with:
platform: ${{ matrix.platform.arch }}
- name: Setup perl for OpenSSl build
uses: shogo82148/actions-setup-perl@v1
if: steps.cache-openssl32.outputs.cache-hit != 'true'
# OQS_USE_OPENSSL=OFF by default on Win32
# if cmake --build fails, try explicit
# cd _build && msbuild ALL_BUILD.vcxproj -p:Configuration=Release
# fails: cmake -DCMAKE_C_FLAGS="/wd5105" -DCMAKE_VERBOSE_MAKEFILE=ON -DCMAKE_INSTALL_PREFIX="c:\liboqs" ${{ matrix.platform.oqsconfig }} -S . -B _build
# cd _build && msbuild ALL_BUILD.vcxproj -p:Configuration=Release && cd ..
# cmake --install _build
- name: build liboqs
run: |
cmake --version
mkdir build
cd build
cmake -GNinja -DCMAKE_C_FLAGS="/wd5105" -DCMAKE_VERBOSE_MAKEFILE=ON -DCMAKE_INSTALL_PREFIX="c:\liboqs" ${{ matrix.platform.oqsconfig }} -DOQS_DIST_BUILD=ON ..
ninja
ninja install
working-directory: liboqs
- name: prepare the OpenSSL build directory
if: steps.cache-openssl32.outputs.cache-hit != 'true'
run: mkdir _build
working-directory: openssl
- name: OpenSSL config
if: steps.cache-openssl32.outputs.cache-hit != 'true'
working-directory: openssl\_build
run: |
perl ..\Configure --banner=Configured --prefix=c:\openssl32 no-makedepend ${{ matrix.platform.osslconfig }}
perl configdata.pm --dump
- name: OpenSSL build
if: steps.cache-openssl32.outputs.cache-hit != 'true'
working-directory: openssl\_build
run: nmake /S
# Skip testing openssl for now
# - name: test
# working-directory: openssl\_build
# run: nmake test VERBOSE_FAILURE=yes TESTS=-test_fuzz* HARNESS_JOBS=4
- name: OpenSSL install
# Run on 64 bit only as 32 bit is slow enough already
if: steps.cache-openssl32.outputs.cache-hit != 'true'
run: |
mkdir c:\openssl32
nmake install_sw
working-directory: openssl\_build
- name: Save OpenSSL
id: cache-openssl-save
if: steps.cache-openssl32.outputs.cache-hit != 'true'
uses: actions/cache/save@v3
with:
path: |
c:\openssl32
key: ${{ runner.os }}-msvcopenssl32
- name: build oqs-provider
run: |
cmake -GNinja -DCMAKE_BUILD_TYPE=Release -DCMAKE_C_FLAGS="/wd5105" -DOPENSSL_ROOT_DIR="c:\openssl32" -Dliboqs_DIR="c:\liboqs\lib\cmake\liboqs" -S . -B _build
cd _build
ninja
- name: Run tests
run: |
ctest -V --test-dir _build
- name: Retain oqsprovider.dll
uses: actions/upload-artifact@v3
with:
name: oqs-provider-msvc
path: D:/a/oqs-provider/oqs-provider/_build/lib/oqsprovider.dll
msvc_native:
# Run a job for each of the specified target architectures:
strategy:
matrix:
os:
- windows-2019
- windows-2022
platform:
- arch: win64
oqsconfig: -DOQS_ALGS_ENABLED=STD
osslconfig: no-shared no-fips VC-WIN64A
toolchain:
- .CMake/toolchain_windows_amd64.cmake
msarch:
- x64
type:
- Debug
- Release
runs-on: ${{matrix.os}}
steps:
- name: Restore native OpenSSL32 cache
id: cache-openssl32n
uses: actions/cache@v3
with:
path: c:\openssl32n
key: ${{ runner.os }}-msvcopenssl32n
- uses: actions/checkout@v3
- name: Checkout OpenSSL master
if: steps.cache-openssl32n.outputs.cache-hit != 'true'
uses: actions/checkout@v3
with:
set-safe-directory: true
repository: openssl/openssl
path: openssl
- uses: actions/checkout@v3
with:
set-safe-directory: true
repository: open-quantum-safe/liboqs
path: liboqs
- uses: ilammy/msvc-dev-cmd@v1
with:
arch: ${{ matrix.platform.arch }}
- name: Add msbuild to PATH
uses: microsoft/setup-msbuild@v1
with:
msbuild-architecture: ${{matrix.msarch}}
vs-version: '[16.10,]'
- name: Setup nasm for OpenSSL build
uses: ilammy/setup-nasm@v1
if: steps.cache-openssl32n.outputs.cache-hit != 'true'
with:
platform: ${{ matrix.platform.arch }}
- name: Setup perl for OpenSSL build
uses: shogo82148/actions-setup-perl@v1
if: steps.cache-openssl32n.outputs.cache-hit != 'true'
- name: build liboqs
run: |
cmake --version
cmake -B build --toolchain ${{ matrix.toolchain }} .
cmake --build build
cmake --build build --target INSTALL
working-directory: liboqs
- name: prepare the OpenSSL build directory
if: steps.cache-openssl32n.outputs.cache-hit != 'true'
run: mkdir _build
working-directory: openssl
- name: OpenSSL config
if: steps.cache-openssl32n.outputs.cache-hit != 'true'
working-directory: openssl\_build
run: |
perl ..\Configure --banner=Configured --prefix=c:\openssl32n no-makedepend ${{ matrix.platform.osslconfig }}
perl configdata.pm --dump
- name: OpenSSL build
if: steps.cache-openssl32n.outputs.cache-hit != 'true'
working-directory: openssl\_build
run: nmake /S
- name: OpenSSL install
# Run on 64 bit only as 32 bit is slow enough already
if: steps.cache-openssl32n.outputs.cache-hit != 'true'
run: |
mkdir c:\openssl32n
nmake install_sw
working-directory: openssl\_build
- name: Save OpenSSL
id: cache-openssl-save
if: steps.cache-openssl32n.outputs.cache-hit != 'true'
uses: actions/cache/save@v3
with:
path: |
c:\openssl32n
key: ${{ runner.os }}-msvcopenssl32n
- name: build oqs-provider
run: |
cmake -DCMAKE_BUILD_TYPE=${{ matrix.type }} -DCMAKE_C_FLAGS="/wd5105" -DOPENSSL_ROOT_DIR="c:\openssl32n" -Dliboqs_DIR="c:\liboqs\lib\cmake\liboqs" -S . -B _build
cmake --build _build --config=${{ matrix.type }}
- name: Run tests
run: |
ctest --test-dir _build -C ${{ matrix.type }}
- name: Retain oqsprovider.dll
uses: actions/upload-artifact@v3
with:
name: oqs-provider-msvc
path: D:/a/oqs-provider/oqs-provider/_build/lib/oqsprovider.dll