]> git.ipfire.org Git - thirdparty/openssl.git/blob - .github/workflows/ci.yml
Bump actions/setup-python from 4.7.1 to 5.0.0
[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: ${{ github.server_url == 'https://github.com' && 'ubuntu-latest' || 'ubuntu-22.04-self-hosted' }}
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: ${{ github.server_url == 'https://github.com' && 'ubuntu-latest' || 'ubuntu-22.04-self-hosted' }}
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: ${{ github.server_url == 'https://github.com' && 'ubuntu-latest' || 'ubuntu-22.04-self-hosted' }}
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: ${{ github.server_url == 'https://github.com' && 'ubuntu-latest' || 'ubuntu-22.04-self-hosted' }}
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: ${{ github.server_url == 'https://github.com' && 'ubuntu-latest' || 'ubuntu-22.04-self-hosted' }}
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 self-hosted:
111 strategy:
112 matrix:
113 os: [freebsd-13.2, ubuntu-arm64-22.04]
114 runs-on: ${{ matrix.os }}-self-hosted
115 continue-on-error: true
116 steps:
117 - uses: actions/checkout@v4
118 - name: config
119 run: ./config enable-fips enable-ec_nistp_64_gcc_128 enable-md2 enable-rc5 enable-ssl3 enable-ssl3-method enable-trace
120 - name: config dump
121 run: ./configdata.pm --dump
122 - name: make
123 run: make -j4
124 - name: get cpu info
125 run: ./util/opensslwrap.sh version -c
126 - name: make test
127 run: make test HARNESS_JOBS=${HARNESS_JOBS:-4}
128
129 minimal:
130 runs-on: ${{ github.server_url == 'https://github.com' && 'ubuntu-latest' || 'ubuntu-22.04-self-hosted' }}
131 steps:
132 - uses: actions/checkout@v4
133 - name: checkout fuzz/corpora submodule
134 run: git submodule update --init --depth 1 fuzz/corpora
135 - name: config
136 run: ./config --banner=Configured --strict-warnings no-bulk no-pic no-asm -DOPENSSL_NO_SECURE_MEMORY -DOPENSSL_SMALL_FOOTPRINT && perl configdata.pm --dump
137 - name: make
138 run: make -j4 # verbose, so no -s here
139 - name: get cpu info
140 run: |
141 cat /proc/cpuinfo
142 ./util/opensslwrap.sh version -c
143 - name: make test
144 run: make test HARNESS_JOBS=${HARNESS_JOBS:-4}
145
146 no-deprecated:
147 runs-on: ${{ github.server_url == 'https://github.com' && 'ubuntu-latest' || 'ubuntu-22.04-self-hosted' }}
148 steps:
149 - uses: actions/checkout@v4
150 - name: checkout fuzz/corpora submodule
151 run: git submodule update --init --depth 1 fuzz/corpora
152 - name: config
153 run: ./config --banner=Configured --strict-warnings no-deprecated enable-fips && perl configdata.pm --dump
154 - name: make
155 run: make -s -j4
156 - name: get cpu info
157 run: |
158 cat /proc/cpuinfo
159 ./util/opensslwrap.sh version -c
160 - name: make test
161 run: make test HARNESS_JOBS=${HARNESS_JOBS:-4}
162
163 no-shared-ubuntu:
164 runs-on: ${{ github.server_url == 'https://github.com' && 'ubuntu-latest' || 'ubuntu-22.04-self-hosted' }}
165 steps:
166 - uses: actions/checkout@v4
167 - name: checkout fuzz/corpora submodule
168 run: git submodule update --init --depth 1 fuzz/corpora
169 - name: config
170 run: ./config --banner=Configured --strict-warnings no-shared no-fips && perl configdata.pm --dump
171 - name: make
172 run: make -s -j4
173 - name: get cpu info
174 run: |
175 cat /proc/cpuinfo
176 ./util/opensslwrap.sh version -c
177 - name: make test
178 run: make test HARNESS_JOBS=${HARNESS_JOBS:-4}
179
180 no-shared-macos:
181 runs-on: macos-latest
182 if: github.server_url == 'https://github.com'
183 steps:
184 - uses: actions/checkout@v4
185 - name: checkout fuzz/corpora submodule
186 run: git submodule update --init --depth 1 fuzz/corpora
187 - name: config
188 run: ./config --banner=Configured --strict-warnings no-shared no-fips && perl configdata.pm --dump
189 - name: make
190 run: make -s -j4
191 - name: get cpu info
192 run: |
193 sysctl machdep.cpu
194 ./util/opensslwrap.sh version -c
195 - name: make test
196 run: make test HARNESS_JOBS=${HARNESS_JOBS:-4}
197
198 non-caching:
199 runs-on: ${{ github.server_url == 'https://github.com' && 'ubuntu-latest' || 'ubuntu-22.04-self-hosted' }}
200 steps:
201 - uses: actions/checkout@v4
202 - name: checkout fuzz/corpora submodule
203 run: git submodule update --init --depth 1 fuzz/corpora
204 - name: config
205 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
206 - name: make
207 run: make -s -j4
208 - name: get cpu info
209 run: |
210 cat /proc/cpuinfo
211 ./util/opensslwrap.sh version -c
212 - name: make test
213 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]"
214
215 address_ub_sanitizer:
216 runs-on: ${{ github.server_url == 'https://github.com' && 'ubuntu-latest' || 'ubuntu-22.04-self-hosted' }}
217 steps:
218 - uses: actions/checkout@v4
219 - name: checkout fuzz/corpora submodule
220 run: git submodule update --init --depth 1 fuzz/corpora
221 - name: config
222 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
223 - name: make
224 run: make -s -j4
225 - name: get cpu info
226 run: |
227 cat /proc/cpuinfo
228 ./util/opensslwrap.sh version -c
229 - name: make test
230 run: make test HARNESS_JOBS=${HARNESS_JOBS:-4} OPENSSL_TEST_RAND_ORDER=0
231
232 fuzz_tests:
233 runs-on: ${{ github.server_url == 'https://github.com' && 'ubuntu-latest' || 'ubuntu-22.04-self-hosted' }}
234 steps:
235 - uses: actions/checkout@v4
236 - name: checkout fuzz/corpora submodule
237 run: git submodule update --init --depth 1 fuzz/corpora
238 - name: config
239 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
240 - name: make
241 run: make -s -j4
242 - name: get cpu info
243 run: |
244 cat /proc/cpuinfo
245 ./util/opensslwrap.sh version -c
246 - name: make test
247 run: make test HARNESS_JOBS=${HARNESS_JOBS:-4} OPENSSL_TEST_RAND_ORDER=0 TESTS="test_fuzz*"
248
249 memory_sanitizer:
250 runs-on: ${{ github.server_url == 'https://github.com' && 'ubuntu-latest' || 'ubuntu-22.04-self-hosted' }}
251 steps:
252 - uses: actions/checkout@v4
253 - name: checkout fuzz/corpora submodule
254 run: git submodule update --init --depth 1 fuzz/corpora
255 - name: config
256 # --debug -O1 is to produce a debug build that runs in a reasonable amount of time
257 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
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} OPENSSL_TEST_RAND_ORDER=0
266
267 threads_sanitizer:
268 runs-on: ${{ github.server_url == 'https://github.com' && 'ubuntu-latest' || 'ubuntu-22.04-self-hosted' }}
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: config
274 run: CC=clang ./config --banner=Configured no-fips --strict-warnings -fsanitize=thread && perl configdata.pm --dump
275 - name: make
276 run: make -s -j4
277 - name: get cpu info
278 run: |
279 cat /proc/cpuinfo
280 ./util/opensslwrap.sh version -c
281 - name: make test
282 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}
283
284 enable_non-default_options:
285 runs-on: ${{ github.server_url == 'https://github.com' && 'ubuntu-latest' || 'ubuntu-22.04-self-hosted' }}
286 steps:
287 - uses: actions/checkout@v4
288 - name: checkout fuzz/corpora submodule
289 run: git submodule update --init --depth 1 fuzz/corpora
290 - name: modprobe tls
291 run: sudo modprobe tls
292 - name: config
293 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
294 - name: make
295 run: make -s -j4
296 - name: get cpu info
297 run: |
298 cat /proc/cpuinfo
299 ./util/opensslwrap.sh version -c
300 - name: make test
301 run: make test HARNESS_JOBS=${HARNESS_JOBS:-4}
302
303 full_featured:
304 runs-on: ${{ github.server_url == 'https://github.com' && 'ubuntu-latest' || 'ubuntu-22.04-self-hosted' }}
305 steps:
306 - uses: actions/checkout@v4
307 - name: checkout fuzz/corpora submodule
308 run: git submodule update --init --depth 1 fuzz/corpora
309 - name: modprobe tls
310 run: sudo modprobe tls
311 - name: Enable sctp
312 run: sudo modprobe sctp
313 - name: Enable auth in sctp
314 run: sudo sysctl -w net.sctp.auth_enable=1
315 - name: install extra config support
316 run: sudo apt-get -y install libsctp-dev abigail-tools libzstd-dev zstd
317 - name: config
318 run: ./config --banner=Configured --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
319 - name: make
320 run: make -s -j4
321 - name: get cpu info
322 run: |
323 cat /proc/cpuinfo
324 ./util/opensslwrap.sh version -c
325 - name: make test
326 run: make test HARNESS_JOBS=${HARNESS_JOBS:-4}
327
328 no-legacy:
329 runs-on: ${{ github.server_url == 'https://github.com' && 'ubuntu-latest' || 'ubuntu-22.04-self-hosted' }}
330 steps:
331 - uses: actions/checkout@v4
332 - name: checkout fuzz/corpora submodule
333 run: git submodule update --init --depth 1 fuzz/corpora
334 - name: config
335 run: ./config --banner=Configured --strict-warnings no-legacy enable-fips && perl configdata.pm --dump
336 - name: make
337 run: make -s -j4
338 - name: get cpu info
339 run: |
340 cat /proc/cpuinfo
341 ./util/opensslwrap.sh version -c
342 - name: make test
343 run: make test HARNESS_JOBS=${HARNESS_JOBS:-4}
344
345 legacy:
346 runs-on: ${{ github.server_url == 'https://github.com' && 'ubuntu-latest' || 'ubuntu-22.04-self-hosted' }}
347 steps:
348 - uses: actions/checkout@v4
349 - name: checkout fuzz/corpora submodule
350 run: git submodule update --init --depth 1 fuzz/corpora
351 - name: config
352 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
353 - name: make
354 run: make -s -j4
355 - name: get cpu info
356 run: |
357 cat /proc/cpuinfo
358 ./util/opensslwrap.sh version -c
359 - name: make test
360 run: make test HARNESS_JOBS=${HARNESS_JOBS:-4}
361
362 # out-of-source-and-install checks multiple things at the same time:
363 # - That building, testing and installing works from an out-of-source
364 # build tree
365 # - That building, testing and installing works with a read-only source
366 # tree
367 out-of-readonly-source-and-install-ubuntu:
368 runs-on: ${{ github.server_url == 'https://github.com' && 'ubuntu-latest' || 'ubuntu-22.04-self-hosted' }}
369 steps:
370 - uses: actions/checkout@v4
371 with:
372 path: ./source
373 - name: checkout fuzz/corpora submodule
374 run: git submodule update --init --depth 1 fuzz/corpora
375 working-directory: ./source
376 - name: make source read-only
377 run: chmod -R a-w ./source
378 - name: create build and install directories
379 run: |
380 mkdir ./build
381 mkdir ./install
382 - name: config
383 run: |
384 ../source/config --banner=Configured enable-fips enable-quic enable-acvp-tests --strict-warnings --prefix=$(cd ../install; pwd)
385 perl configdata.pm --dump
386 working-directory: ./build
387 - name: make
388 run: make -s -j4
389 working-directory: ./build
390 - name: get cpu info
391 run: |
392 cat /proc/cpuinfo
393 ./util/opensslwrap.sh version -c
394 working-directory: ./build
395 - name: make test
396 run: make test HARNESS_JOBS=${HARNESS_JOBS:-4}
397 working-directory: ./build
398 - name: make install
399 run: make install
400 working-directory: ./build
401
402 out-of-readonly-source-and-install-macos:
403 runs-on: macos-latest
404 if: github.server_url == 'https://github.com'
405 steps:
406 - uses: actions/checkout@v4
407 with:
408 path: ./source
409 - name: checkout fuzz/corpora submodule
410 run: git submodule update --init --depth 1 fuzz/corpora
411 working-directory: ./source
412 - name: make source read-only
413 run: chmod -R a-w ./source
414 - name: create build and install directories
415 run: |
416 mkdir ./build
417 mkdir ./install
418 - name: config
419 run: |
420 ../source/config --banner=Configured enable-fips enable-quic enable-acvp-tests --strict-warnings --prefix=$(cd ../install; pwd)
421 perl configdata.pm --dump
422 working-directory: ./build
423 - name: make
424 run: make -s -j4
425 working-directory: ./build
426 - name: get cpu info
427 run: |
428 sysctl machdep.cpu
429 ./util/opensslwrap.sh version -c
430 working-directory: ./build
431 - name: make test
432 run: make test HARNESS_JOBS=${HARNESS_JOBS:-4}
433 working-directory: ./build
434 - name: make install
435 run: make install
436 working-directory: ./build
437
438 external-tests:
439 runs-on: ${{ github.server_url == 'https://github.com' && 'ubuntu-latest' || 'ubuntu-22.04-self-hosted' }}
440 steps:
441 - uses: actions/checkout@v4
442 with:
443 submodules: recursive
444 - name: package installs
445 run: |
446 sudo apt-get update
447 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
448 - name: install cpanm and Test2::V0 for gost_engine testing
449 uses: perl-actions/install-with-cpanm@v1
450 with:
451 install: Test2::V0
452 - name: setup hostname workaround
453 run: sudo hostname localhost
454 - name: config
455 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
456 - name: make
457 run: make -s -j4
458 - name: get cpu info
459 run: |
460 cat /proc/cpuinfo
461 ./util/opensslwrap.sh version -c
462 - name: test external gost-engine
463 run: make test TESTS="test_external_gost_engine"
464 - name: test external krb5
465 run: make test TESTS="test_external_krb5"
466 - name: test external_tlsfuzzer
467 run: make test TESTS="test_external_tlsfuzzer"
468 - name: test external oqs-provider
469 run: make test TESTS="test_external_oqsprovider"
470
471 external-test-pyca:
472 runs-on: ${{ github.server_url == 'https://github.com' && 'ubuntu-latest' || 'ubuntu-22.04-self-hosted' }}
473 strategy:
474 matrix:
475 RUST:
476 - 1.51.0
477 PYTHON:
478 - 3.9
479 steps:
480 - uses: actions/checkout@v4
481 with:
482 submodules: recursive
483 - name: Configure OpenSSL
484 run: ./config --banner=Configured --strict-warnings --debug enable-external-tests && perl configdata.pm --dump
485 - name: make
486 run: make -s -j4
487 - name: Setup Python
488 uses: actions/setup-python@v5.0.0
489 with:
490 python-version: ${{ matrix.PYTHON }}
491 - uses: actions-rs/toolchain@v1
492 with:
493 profile: minimal
494 toolchain: ${{ matrix.RUST }}
495 override: true
496 default: true
497 - name: get cpu info
498 run: |
499 cat /proc/cpuinfo
500 ./util/opensslwrap.sh version -c
501 - name: test external pyca
502 run: make test TESTS="test_external_pyca" VERBOSE=1
503
504 external-test-cf-quiche:
505 runs-on: ${{ github.server_url == 'https://github.com' && 'ubuntu-latest' || 'ubuntu-22.04-self-hosted' }}
506 steps:
507 - uses: actions/checkout@v4
508 with:
509 submodules: recursive
510 - name: Configure OpenSSL
511 run: ./config --banner=Configured --strict-warnings enable-external-tests && perl configdata.pm --dump
512 - name: make
513 run: make -s -j4
514 - uses: actions-rs/toolchain@v1
515 with:
516 profile: default
517 toolchain: stable
518 default: true
519 - name: get cpu info
520 run: |
521 cat /proc/cpuinfo
522 ./util/opensslwrap.sh version -c
523 - name: test external Cloudflare quiche
524 run: make test TESTS="test_external_cf_quiche" VERBOSE=1