]> git.ipfire.org Git - thirdparty/openssl.git/blob - .github/workflows/ci.yml
Update ci and ABI xml files to validate function parameters
[thirdparty/openssl.git] / .github / workflows / ci.yml
1 # Copyright 2021-2023 The OpenSSL Project Authors. All Rights Reserved.
2 #
3 # Licensed under the Apache License 2.0 (the "License"). You may not use
4 # this file except in compliance with the License. You can obtain a copy
5 # in the file LICENSE in the source distribution or at
6 # https://www.openssl.org/source/license.html
7
8 name: GitHub CI
9
10 on: [pull_request, push]
11
12 # for some reason, this does not work:
13 # variables:
14 # BUILDOPTS: "-j4"
15 # HARNESS_JOBS: "${HARNESS_JOBS:-4}"
16
17 # for some reason, this does not work:
18 # before_script:
19 # - make="make -s"
20
21 permissions:
22 contents: read
23
24 jobs:
25 check_update:
26 runs-on: ubuntu-latest
27 steps:
28 - name: install unifdef
29 run: |
30 sudo apt-get update
31 sudo apt-get -yq --no-install-suggests --no-install-recommends --force-yes install unifdef
32 - uses: actions/checkout@v4
33 with:
34 fetch-depth: 0
35 - name: config
36 run: ./config --banner=Configured --strict-warnings enable-fips && perl configdata.pm --dump
37 - name: make build_generated
38 run: make -s build_generated
39 - name: make update
40 run: make update
41 - name: git diff
42 run: git diff --exit-code
43
44 check_docs:
45 runs-on: ubuntu-latest
46 steps:
47 - uses: actions/checkout@v4
48 - name: config
49 run: ./config --banner=Configured --strict-warnings enable-fips && perl configdata.pm --dump
50 - name: make build_generated
51 run: make -s build_generated
52 - name: make doc-nits
53 run: make doc-nits
54 - name: make help
55 run: make help
56 - name: make md-nits
57 run: |
58 sudo gem install mdl
59 make md-nits
60
61 # This checks that we use ANSI C language syntax and semantics.
62 # We are not as strict with libraries, but rather adapt to what's
63 # expected to be available in a certain version of each platform.
64 check-ansi:
65 runs-on: ubuntu-latest
66 steps:
67 - uses: actions/checkout@v4
68 - name: config
69 run: CPPFLAGS=-ansi ./config --banner=Configured no-asm no-makedepend enable-buildtest-c++ enable-fips --strict-warnings -D_DEFAULT_SOURCE && perl configdata.pm --dump
70 - name: make
71 run: make -s -j4
72
73 basic_gcc:
74 runs-on: ubuntu-latest
75 steps:
76 - uses: actions/checkout@v4
77 - name: checkout fuzz/corpora submodule
78 run: git submodule update --init --depth 1 fuzz/corpora
79 - name: localegen
80 run: sudo locale-gen tr_TR.UTF-8
81 - name: config
82 # enable-quic is on by default, but we leave it here to check we're testing the explicit enable somewhere
83 run: CC=gcc ./config --banner=Configured enable-fips enable-quic --strict-warnings && perl configdata.pm --dump
84 - name: make
85 run: make -s -j4
86 - name: get cpu info
87 run: |
88 cat /proc/cpuinfo
89 ./util/opensslwrap.sh version -c
90 - name: make test
91 run: make test HARNESS_JOBS=${HARNESS_JOBS:-4}
92
93 basic_clang:
94 runs-on: ubuntu-latest
95 steps:
96 - uses: actions/checkout@v4
97 - name: checkout fuzz/corpora submodule
98 run: git submodule update --init --depth 1 fuzz/corpora
99 - name: config
100 run: CC=clang ./config --banner=Configured no-fips --strict-warnings && perl configdata.pm --dump
101 - name: make
102 run: make -s -j4
103 - name: get cpu info
104 run: |
105 cat /proc/cpuinfo
106 ./util/opensslwrap.sh version -c
107 - name: make test
108 run: make test HARNESS_JOBS=${HARNESS_JOBS:-4}
109
110 minimal:
111 runs-on: ubuntu-latest
112 steps:
113 - uses: actions/checkout@v4
114 - name: checkout fuzz/corpora submodule
115 run: git submodule update --init --depth 1 fuzz/corpora
116 - name: config
117 run: ./config --banner=Configured --strict-warnings no-bulk no-pic no-asm -DOPENSSL_NO_SECURE_MEMORY -DOPENSSL_SMALL_FOOTPRINT && perl configdata.pm --dump
118 - name: make
119 run: make -j4 # verbose, so no -s here
120 - name: get cpu info
121 run: |
122 cat /proc/cpuinfo
123 ./util/opensslwrap.sh version -c
124 - name: make test
125 run: make test HARNESS_JOBS=${HARNESS_JOBS:-4}
126
127 no-deprecated:
128 runs-on: ubuntu-latest
129 steps:
130 - uses: actions/checkout@v4
131 - name: checkout fuzz/corpora submodule
132 run: git submodule update --init --depth 1 fuzz/corpora
133 - name: config
134 run: ./config --banner=Configured --strict-warnings no-deprecated enable-fips && perl configdata.pm --dump
135 - name: make
136 run: make -s -j4
137 - name: get cpu info
138 run: |
139 cat /proc/cpuinfo
140 ./util/opensslwrap.sh version -c
141 - name: make test
142 run: make test HARNESS_JOBS=${HARNESS_JOBS:-4}
143
144 no-shared:
145 strategy:
146 matrix:
147 os: [ ubuntu-latest, macos-latest ]
148 runs-on: ${{matrix.os}}
149 steps:
150 - uses: actions/checkout@v4
151 - name: checkout fuzz/corpora submodule
152 run: git submodule update --init --depth 1 fuzz/corpora
153 - name: config
154 run: ./config --banner=Configured --strict-warnings no-shared no-fips && perl configdata.pm --dump
155 - name: make
156 run: make -s -j4
157 - name: get cpu info
158 run: ./util/opensslwrap.sh version -c
159 - name: make test
160 run: make test HARNESS_JOBS=${HARNESS_JOBS:-4}
161
162 non-caching:
163 runs-on: ubuntu-latest
164 steps:
165 - uses: actions/checkout@v4
166 - name: checkout fuzz/corpora submodule
167 run: git submodule update --init --depth 1 fuzz/corpora
168 - name: config
169 run: ./config --banner=Configured --debug enable-asan enable-ubsan no-cached-fetch no-fips no-dtls no-tls1 no-tls1-method no-tls1_1 no-tls1_1-method no-async && perl configdata.pm --dump
170 - name: make
171 run: make -s -j4
172 - name: get cpu info
173 run: |
174 cat /proc/cpuinfo
175 ./util/opensslwrap.sh version -c
176 - name: make test
177 run: make test HARNESS_JOBS=${HARNESS_JOBS:-4} OPENSSL_TEST_RAND_ORDER=0 TESTS="-test_fuzz* -test_ssl_* -test_sslapi -test_evp -test_cmp_http -test_verify -test_cms -test_store -test_enc -[01][0-9]"
178
179 address_ub_sanitizer:
180 runs-on: ubuntu-latest
181 steps:
182 - uses: actions/checkout@v4
183 - name: checkout fuzz/corpora submodule
184 run: git submodule update --init --depth 1 fuzz/corpora
185 - name: config
186 run: ./config --banner=Configured --debug enable-asan enable-ubsan enable-rc5 enable-md2 enable-ec_nistp_64_gcc_128 enable-fips && perl configdata.pm --dump
187 - name: make
188 run: make -s -j4
189 - name: get cpu info
190 run: |
191 cat /proc/cpuinfo
192 ./util/opensslwrap.sh version -c
193 - name: make test
194 run: make test HARNESS_JOBS=${HARNESS_JOBS:-4} OPENSSL_TEST_RAND_ORDER=0
195
196 fuzz_tests:
197 runs-on: ubuntu-latest
198 steps:
199 - uses: actions/checkout@v4
200 - name: checkout fuzz/corpora submodule
201 run: git submodule update --init --depth 1 fuzz/corpora
202 - name: config
203 run: ./config --banner=Configured --debug -DPEDANTIC -DFUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION enable-asan enable-ubsan enable-rc5 enable-md2 enable-ec_nistp_64_gcc_128 enable-weak-ssl-ciphers enable-ssl3 enable-ssl3-method enable-nextprotoneg && perl configdata.pm --dump
204 - name: make
205 run: make -s -j4
206 - name: get cpu info
207 run: |
208 cat /proc/cpuinfo
209 ./util/opensslwrap.sh version -c
210 - name: make test
211 run: make test HARNESS_JOBS=${HARNESS_JOBS:-4} OPENSSL_TEST_RAND_ORDER=0 TESTS="test_fuzz*"
212
213 memory_sanitizer:
214 runs-on: ubuntu-latest
215 steps:
216 - uses: actions/checkout@v4
217 - name: checkout fuzz/corpora submodule
218 run: git submodule update --init --depth 1 fuzz/corpora
219 - name: config
220 # --debug -O1 is to produce a debug build that runs in a reasonable amount of time
221 run: CC=clang ./config --banner=Configured --debug -O1 -fsanitize=memory -DOSSL_SANITIZE_MEMORY -fno-optimize-sibling-calls enable-rc5 enable-md2 enable-ec_nistp_64_gcc_128 enable-fips && perl configdata.pm --dump
222 - name: make
223 run: make -s -j4
224 - name: get cpu info
225 run: |
226 cat /proc/cpuinfo
227 ./util/opensslwrap.sh version -c
228 - name: make test
229 run: make test HARNESS_JOBS=${HARNESS_JOBS:-4} OPENSSL_TEST_RAND_ORDER=0
230
231 threads_sanitizer:
232 runs-on: ubuntu-latest
233 steps:
234 - uses: actions/checkout@v4
235 - name: checkout fuzz/corpora submodule
236 run: git submodule update --init --depth 1 fuzz/corpora
237 - name: config
238 run: CC=clang ./config --banner=Configured no-fips --strict-warnings -fsanitize=thread && perl configdata.pm --dump
239 - name: make
240 run: make -s -j4
241 - name: get cpu info
242 run: |
243 cat /proc/cpuinfo
244 ./util/opensslwrap.sh version -c
245 - name: make test
246 run: make V=1 TESTS="test_threads test_internal_provider test_provfetch test_provider test_pbe test_evp_kdf test_pkcs12 test_store test_evp test_quic*" test HARNESS_JOBS=${HARNESS_JOBS:-4}
247
248 enable_non-default_options:
249 runs-on: ubuntu-latest
250 steps:
251 - uses: actions/checkout@v4
252 - name: checkout fuzz/corpora submodule
253 run: git submodule update --init --depth 1 fuzz/corpora
254 - name: modprobe tls
255 run: sudo modprobe tls
256 - name: config
257 run: ./config --banner=Configured --strict-warnings no-ec enable-ssl-trace enable-zlib enable-zlib-dynamic enable-crypto-mdebug enable-egd enable-ktls enable-fips no-threads && perl configdata.pm --dump
258 - name: make
259 run: make -s -j4
260 - name: get cpu info
261 run: |
262 cat /proc/cpuinfo
263 ./util/opensslwrap.sh version -c
264 - name: make test
265 run: make test HARNESS_JOBS=${HARNESS_JOBS:-4}
266
267 fips_and_ktls:
268 runs-on: ubuntu-latest
269 steps:
270 - uses: actions/checkout@v4
271 - name: checkout fuzz/corpora submodule
272 run: git submodule update --init --depth 1 fuzz/corpora
273 - name: modprobe tls
274 run: sudo modprobe tls
275 - name: Enable sctp
276 run: sudo modprobe sctp
277 - name: Enable auth in sctp
278 run: sudo sysctl -w net.sctp.auth_enable=1
279 - name: install extra config support
280 run: sudo apt-get -y install libsctp-dev abigail-tools libzstd-dev zstd
281 - name: config
282 run: ./config --banner=Configured -g --strict-warnings enable-ktls enable-fips enable-egd enable-ec_nistp_64_gcc_128 enable-md2 enable-rc5 enable-sctp enable-ssl3 enable-ssl3-method enable-trace enable-zlib enable-zstd && perl configdata.pm --dump
283 - name: make
284 run: make -s -j4
285 - name: get cpu info
286 run: |
287 cat /proc/cpuinfo
288 ./util/opensslwrap.sh version -c
289 - name: Check ABI compatibility for libcrypto
290 run: abidiff ./.github/workflows/libcrypto-abi.xml ./libcrypto.so
291 - name: Check ABI compatibility for libssl
292 run: abidiff ./.github/workflows/libssl-abi.xml ./libssl.so
293 - name: make test
294 run: make test HARNESS_JOBS=${HARNESS_JOBS:-4}
295
296 no-legacy:
297 runs-on: ubuntu-latest
298 steps:
299 - uses: actions/checkout@v4
300 - name: checkout fuzz/corpora submodule
301 run: git submodule update --init --depth 1 fuzz/corpora
302 - name: config
303 run: ./config --banner=Configured --strict-warnings no-legacy enable-fips && perl configdata.pm --dump
304 - name: make
305 run: make -s -j4
306 - name: get cpu info
307 run: |
308 cat /proc/cpuinfo
309 ./util/opensslwrap.sh version -c
310 - name: make test
311 run: make test HARNESS_JOBS=${HARNESS_JOBS:-4}
312
313 legacy:
314 runs-on: ubuntu-latest
315 steps:
316 - uses: actions/checkout@v4
317 - name: checkout fuzz/corpora submodule
318 run: git submodule update --init --depth 1 fuzz/corpora
319 - name: config
320 run: ./config --banner=Configured -Werror --debug no-afalgeng no-shared enable-crypto-mdebug enable-rc5 enable-md2 enable-ssl3 enable-ssl3-method enable-weak-ssl-ciphers enable-zlib enable-ec_nistp_64_gcc_128 no-fips && perl configdata.pm --dump
321 - name: make
322 run: make -s -j4
323 - name: get cpu info
324 run: |
325 cat /proc/cpuinfo
326 ./util/opensslwrap.sh version -c
327 - name: make test
328 run: make test HARNESS_JOBS=${HARNESS_JOBS:-4}
329
330 out-of-source-and-install:
331 strategy:
332 matrix:
333 os: [ubuntu-latest, macos-latest ]
334 runs-on: ${{matrix.os}}
335 steps:
336 - uses: actions/checkout@v4
337 - name: checkout fuzz/corpora submodule
338 run: git submodule update --init --depth 1 fuzz/corpora
339 - name: extra preparations
340 run: |
341 mkdir ./build
342 mkdir ./install
343 - name: config
344 run: ../config --banner=Configured enable-fips enable-acvp-tests --strict-warnings --prefix=$(cd ../install; pwd) && perl configdata.pm --dump
345 working-directory: ./build
346 - name: make
347 run: make -s -j4
348 working-directory: ./build
349 - name: get cpu info
350 run: ./util/opensslwrap.sh version -c
351 working-directory: ./build
352 - name: make test
353 run: make test HARNESS_JOBS=${HARNESS_JOBS:-4}
354 working-directory: ./build
355 - name: make install
356 run: make install
357 working-directory: ./build
358
359 external-tests:
360 runs-on: ubuntu-latest
361 steps:
362 - uses: actions/checkout@v4
363 with:
364 submodules: recursive
365 - name: package installs
366 run: |
367 sudo apt-get update
368 sudo apt-get -yq install bison gettext keyutils ldap-utils libldap2-dev libkeyutils-dev python3 python3-paste python3-pyrad slapd tcsh python3-virtualenv virtualenv python3-kdcproxy
369 - name: install cpanm and Test2::V0 for gost_engine testing
370 uses: perl-actions/install-with-cpanm@v1
371 with:
372 install: Test2::V0
373 - name: setup hostname workaround
374 run: sudo hostname localhost
375 - name: config
376 run: ./config --banner=Configured --strict-warnings --debug no-afalgeng enable-rc5 enable-md2 enable-ssl3 enable-ssl3-method enable-weak-ssl-ciphers enable-zlib enable-ec_nistp_64_gcc_128 enable-external-tests no-fips && perl configdata.pm --dump
377 - name: make
378 run: make -s -j4
379 - name: get cpu info
380 run: |
381 cat /proc/cpuinfo
382 ./util/opensslwrap.sh version -c
383 - name: test external gost-engine
384 run: make test TESTS="test_external_gost_engine"
385 - name: test external krb5
386 run: make test TESTS="test_external_krb5"
387 - name: test external_tlsfuzzer
388 run: make test TESTS="test_external_tlsfuzzer"
389 - name: test external oqs-provider
390 run: make test TESTS="test_external_oqsprovider"
391
392 external-test-pyca:
393 runs-on: ubuntu-latest
394 strategy:
395 matrix:
396 RUST:
397 - 1.51.0
398 PYTHON:
399 - 3.9
400 steps:
401 - uses: actions/checkout@v4
402 with:
403 submodules: recursive
404 - name: Configure OpenSSL
405 run: ./config --banner=Configured --strict-warnings --debug enable-external-tests && perl configdata.pm --dump
406 - name: make
407 run: make -s -j4
408 - name: Setup Python
409 uses: actions/setup-python@v4.7.1
410 with:
411 python-version: ${{ matrix.PYTHON }}
412 - uses: actions-rs/toolchain@v1
413 with:
414 profile: minimal
415 toolchain: ${{ matrix.RUST }}
416 override: true
417 default: true
418 - name: get cpu info
419 run: |
420 cat /proc/cpuinfo
421 ./util/opensslwrap.sh version -c
422 - name: test external pyca
423 run: make test TESTS="test_external_pyca" VERBOSE=1
424
425 external-test-cf-quiche:
426 runs-on: ubuntu-latest
427 steps:
428 - uses: actions/checkout@v4
429 with:
430 submodules: recursive
431 - name: Configure OpenSSL
432 run: ./config --banner=Configured --strict-warnings enable-external-tests && perl configdata.pm --dump
433 - name: make
434 run: make -s -j4
435 - uses: actions-rs/toolchain@v1
436 with:
437 profile: default
438 toolchain: stable
439 default: true
440 - name: get cpu info
441 run: |
442 cat /proc/cpuinfo
443 ./util/opensslwrap.sh version -c
444 - name: test external Cloudflare quiche
445 run: make test TESTS="test_external_cf_quiche" VERBOSE=1