Introduce libabigail checking in ci
[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 --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   enable_brotli_dynamic:
297     runs-on: ubuntu-latest
298     steps:
299     - name: install brotli
300       run: |
301         sudo apt-get update
302         sudo apt-get -yq --no-install-suggests --no-install-recommends --force-yes install brotli libbrotli1 libbrotli-dev
303     - name: checkout openssl
304       uses: actions/checkout@v4
305     - name: checkout fuzz/corpora submodule
306       run: git submodule update --init --depth 1 fuzz/corpora
307     - name: config
308       run: ./config enable-comp enable-brotli enable-brotli-dynamic && perl configdata.pm --dump
309     - name: make
310       run: make -s -j4
311     - name: get cpu info
312       run: |
313         cat /proc/cpuinfo
314         ./util/opensslwrap.sh version -c
315     - name: make test
316       run: make test HARNESS_JOBS=${HARNESS_JOBS:-4}
317
318   enable_zstd_dynamic:
319     runs-on: ubuntu-latest
320     steps:
321     - name: install zstd
322       run: |
323         sudo apt-get update
324         sudo apt-get -yq --no-install-suggests --no-install-recommends --force-yes install zstd libzstd1 libzstd-dev
325     - name: checkout openssl
326       uses: actions/checkout@v4
327     - name: checkout fuzz/corpora submodule
328       run: git submodule update --init --depth 1 fuzz/corpora
329     - name: config
330       run: ./config enable-comp enable-zstd enable-zstd-dynamic && perl configdata.pm --dump
331     - name: make
332       run: make -s -j4
333     - name: get cpu info
334       run: |
335         cat /proc/cpuinfo
336         ./util/opensslwrap.sh version -c
337     - name: make test
338       run: make test HARNESS_JOBS=${HARNESS_JOBS:-4}
339
340   enable_brotli_and_zstd_dynamic:
341     runs-on: ubuntu-latest
342     steps:
343     - name: install brotli and zstd
344       run: |
345         sudo apt-get update
346         sudo apt-get -yq --no-install-suggests --no-install-recommends --force-yes install brotli libbrotli1 libbrotli-dev
347         sudo apt-get -yq --no-install-suggests --no-install-recommends --force-yes install zstd libzstd1 libzstd-dev
348     - name: checkout openssl
349       uses: actions/checkout@v4
350     - name: checkout fuzz/corpora submodule
351       run: git submodule update --init --depth 1 fuzz/corpora
352     - name: config
353       run: ./config enable-comp enable-brotli enable-brotli-dynamic enable-zstd enable-zstd-dynamic && perl configdata.pm --dump
354     - name: make
355       run: make -s -j4
356     - name: get cpu info
357       run: |
358         cat /proc/cpuinfo
359         ./util/opensslwrap.sh version -c
360     - name: make test
361       run: make test HARNESS_JOBS=${HARNESS_JOBS:-4}
362
363   enable_brotli_and_asan_ubsan:
364     runs-on: ubuntu-latest
365     steps:
366     - name: install brotli
367       run: |
368         sudo apt-get update
369         sudo apt-get -yq --no-install-suggests --no-install-recommends --force-yes install brotli libbrotli1 libbrotli-dev
370     - name: checkout openssl
371       uses: actions/checkout@v4
372     - name: checkout fuzz/corpora submodule
373       run: git submodule update --init --depth 1 fuzz/corpora
374     - name: config
375       run: ./config --banner=Configured --debug enable-asan enable-ubsan enable-comp enable-brotli -DPEDANTIC && perl configdata.pm --dump
376     - name: make
377       run: make -s -j4
378     - name: get cpu info
379       run: |
380         cat /proc/cpuinfo
381         ./util/opensslwrap.sh version -c
382     - name: make test
383       run: make test HARNESS_JOBS=${HARNESS_JOBS:-4} OPENSSL_TEST_RAND_ORDER=0
384
385   enable_zstd_and_asan_ubsan:
386     runs-on: ubuntu-latest
387     steps:
388     - name: install zstd
389       run: |
390         sudo apt-get update
391         sudo apt-get -yq --no-install-suggests --no-install-recommends --force-yes install zstd libzstd1 libzstd-dev
392     - name: checkout openssl
393       uses: actions/checkout@v4
394     - name: checkout fuzz/corpora submodule
395       run: git submodule update --init --depth 1 fuzz/corpora
396     - name: config
397       run: ./config --banner=Configured --debug enable-asan enable-ubsan enable-comp enable-zstd -DPEDANTIC && perl configdata.pm --dump
398     - name: make
399       run: make -s -j4
400     - name: get cpu info
401       run: |
402         cat /proc/cpuinfo
403         ./util/opensslwrap.sh version -c
404     - name: make test
405       run: make test HARNESS_JOBS=${HARNESS_JOBS:-4} OPENSSL_TEST_RAND_ORDER=0
406
407   no-legacy:
408     runs-on: ubuntu-latest
409     steps:
410     - uses: actions/checkout@v4
411     - name: checkout fuzz/corpora submodule
412       run: git submodule update --init --depth 1 fuzz/corpora
413     - name: config
414       run: ./config --banner=Configured --strict-warnings no-legacy enable-fips && perl configdata.pm --dump
415     - name: make
416       run: make -s -j4
417     - name: get cpu info
418       run: |
419         cat /proc/cpuinfo
420         ./util/opensslwrap.sh version -c
421     - name: make test
422       run: make test HARNESS_JOBS=${HARNESS_JOBS:-4}
423
424   legacy:
425     runs-on: ubuntu-latest
426     steps:
427     - uses: actions/checkout@v4
428     - name: checkout fuzz/corpora submodule
429       run: git submodule update --init --depth 1 fuzz/corpora
430     - name: config
431       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
432     - name: make
433       run: make -s -j4
434     - name: get cpu info
435       run: |
436         cat /proc/cpuinfo
437         ./util/opensslwrap.sh version -c
438     - name: make test
439       run: make test HARNESS_JOBS=${HARNESS_JOBS:-4}
440
441   enable-tfo:
442     strategy:
443       matrix:
444         os: [ ubuntu-latest, macos-latest ]
445     runs-on: ${{matrix.os}}
446     steps:
447     - uses: actions/checkout@v4
448     - name: checkout fuzz/corpora submodule
449       run: git submodule update --init --depth 1 fuzz/corpora
450     - name: config
451       run: CC=gcc ./config --banner=Configured enable-tfo --strict-warnings && perl configdata.pm --dump
452     - name: make
453       run: make -s -j4
454     - name: get cpu info
455       run: ./util/opensslwrap.sh version -c
456     - name: make test
457       run: make test HARNESS_JOBS=${HARNESS_JOBS:-4}
458
459   buildtest:
460     runs-on: ubuntu-latest
461     steps:
462     - uses: actions/checkout@v4
463     - name: checkout fuzz/corpora submodule
464       run: git submodule update --init --depth 1 fuzz/corpora
465     - name: config
466       run: ./config --banner=Configured no-asm no-makedepend enable-buildtest-c++ enable-fips --strict-warnings -D_DEFAULT_SOURCE && perl configdata.pm --dump
467     - name: make
468       run: make -s -j4
469     - name: get cpu info
470       run: |
471         cat /proc/cpuinfo
472         ./util/opensslwrap.sh version -c
473     - name: make test
474       run: make test HARNESS_JOBS=${HARNESS_JOBS:-4}
475
476   out-of-source-and-install:
477     strategy:
478       matrix:
479         os: [ubuntu-latest, macos-latest ]
480     runs-on: ${{matrix.os}}
481     steps:
482     - uses: actions/checkout@v4
483     - name: checkout fuzz/corpora submodule
484       run: git submodule update --init --depth 1 fuzz/corpora
485     - name: extra preparations
486       run: |
487         mkdir ./build
488         mkdir ./install
489     - name: config
490       run: ../config --banner=Configured enable-fips enable-acvp-tests --strict-warnings --prefix=$(cd ../install; pwd) && perl configdata.pm --dump
491       working-directory: ./build
492     - name: make
493       run: make -s -j4
494       working-directory: ./build
495     - name: get cpu info
496       run: ./util/opensslwrap.sh version -c
497       working-directory: ./build
498     - name: make test
499       run: make test HARNESS_JOBS=${HARNESS_JOBS:-4}
500       working-directory: ./build
501     - name: make install
502       run: make install
503       working-directory: ./build
504
505   external-tests:
506     runs-on: ubuntu-latest
507     steps:
508     - uses: actions/checkout@v4
509       with:
510         submodules: recursive
511     - name: package installs
512       run: |
513         sudo apt-get update
514         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
515     - name: install cpanm and Test2::V0 for gost_engine testing
516       uses: perl-actions/install-with-cpanm@v1
517       with:
518         install: Test2::V0
519     - name: setup hostname workaround
520       run: sudo hostname localhost
521     - name: config
522       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
523     - name: make
524       run: make -s -j4
525     - name: get cpu info
526       run: |
527         cat /proc/cpuinfo
528         ./util/opensslwrap.sh version -c
529     - name: test external gost-engine
530       run: make test TESTS="test_external_gost_engine"
531     - name: test external krb5
532       run: make test TESTS="test_external_krb5"
533     - name: test external_tlsfuzzer
534       run: make test TESTS="test_external_tlsfuzzer"
535     - name: test external oqs-provider
536       run: make test TESTS="test_external_oqsprovider"
537
538   external-test-pyca:
539     runs-on: ubuntu-latest
540     strategy:
541       matrix:
542         RUST:
543           - 1.51.0
544         PYTHON:
545           - 3.9
546     steps:
547     - uses: actions/checkout@v4
548       with:
549         submodules: recursive
550     - name: Configure OpenSSL
551       run: ./config --banner=Configured --strict-warnings --debug enable-external-tests && perl configdata.pm --dump
552     - name: make
553       run: make -s -j4
554     - name: Setup Python
555       uses: actions/setup-python@v4.7.1
556       with:
557         python-version: ${{ matrix.PYTHON }}
558     - uses: actions-rs/toolchain@v1
559       with:
560         profile: minimal
561         toolchain: ${{ matrix.RUST }}
562         override: true
563         default: true
564     - name: get cpu info
565       run: |
566         cat /proc/cpuinfo
567         ./util/opensslwrap.sh version -c
568     - name: test external pyca
569       run: make test TESTS="test_external_pyca" VERBOSE=1
570
571   external-test-cf-quiche:
572     runs-on: ubuntu-latest
573     steps:
574     - uses: actions/checkout@v4
575       with:
576         submodules: recursive
577     - name: Configure OpenSSL
578       run: ./config --banner=Configured --strict-warnings enable-external-tests && perl configdata.pm --dump
579     - name: make
580       run: make -s -j4
581     - uses: actions-rs/toolchain@v1
582       with:
583         profile: default
584         toolchain: stable
585         default: true
586     - name: get cpu info
587       run: |
588         cat /proc/cpuinfo
589         ./util/opensslwrap.sh version -c
590     - name: test external Cloudflare quiche
591       run: make test TESTS="test_external_cf_quiche" VERBOSE=1