QUIC: Add to threads sanitizer CI
[openssl.git] / .github / workflows / ci.yml
1 # Copyright 2021-2022 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@v3
33       with:
34         fetch-depth: 0
35     - name: config
36       run: ./config --banner=Configured --strict-warnings enable-fips enable-quic && 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@v3
48     - name: config
49       run: ./config --banner=Configured --strict-warnings enable-fips enable-quic && 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@v3
68     - name: config
69       run: CPPFLAGS=-ansi ./config --banner=Configured no-asm no-makedepend enable-buildtest-c++ enable-fips enable-quic --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@v3
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       run: CC=gcc ./config --banner=Configured enable-fips enable-quic --strict-warnings && perl configdata.pm --dump
83     - name: make
84       run: make -s -j4
85     - name: make test
86       run: make test HARNESS_JOBS=${HARNESS_JOBS:-4}
87
88   basic_clang:
89     runs-on: ubuntu-latest
90     steps:
91     - uses: actions/checkout@v3
92     - name: checkout fuzz/corpora submodule
93       run: git submodule update --init --depth 1 fuzz/corpora
94     - name: config
95       run: CC=clang ./config --banner=Configured no-fips --strict-warnings && perl configdata.pm --dump
96     - name: make
97       run: make -s -j4
98     - name: make test
99       run: make test HARNESS_JOBS=${HARNESS_JOBS:-4}
100
101   minimal:
102     runs-on: ubuntu-latest
103     steps:
104     - uses: actions/checkout@v3
105     - name: checkout fuzz/corpora submodule
106       run: git submodule update --init --depth 1 fuzz/corpora
107     - name: config
108       run: ./config --banner=Configured --strict-warnings no-bulk no-pic no-asm -DOPENSSL_NO_SECURE_MEMORY -DOPENSSL_SMALL_FOOTPRINT && perl configdata.pm --dump
109     - name: make
110       run: make -j4 # verbose, so no -s here
111     - name: make test
112       run: make test HARNESS_JOBS=${HARNESS_JOBS:-4}
113
114   no-deprecated:
115     runs-on: ubuntu-latest
116     steps:
117     - uses: actions/checkout@v3
118     - name: checkout fuzz/corpora submodule
119       run: git submodule update --init --depth 1 fuzz/corpora
120     - name: config
121       run: ./config --banner=Configured --strict-warnings no-deprecated enable-fips enable-quic && perl configdata.pm --dump
122     - name: make
123       run: make -s -j4
124     - name: make test
125       run: make test HARNESS_JOBS=${HARNESS_JOBS:-4}
126
127   no-shared:
128     strategy:
129       matrix:
130         os: [ ubuntu-latest, macos-latest ]
131     runs-on: ${{matrix.os}}
132     steps:
133     - uses: actions/checkout@v3
134     - name: checkout fuzz/corpora submodule
135       run: git submodule update --init --depth 1 fuzz/corpora
136     - name: config
137       run: ./config --banner=Configured --strict-warnings no-shared no-fips && perl configdata.pm --dump
138     - name: make
139       run: make -s -j4
140     - name: make test
141       run: make test HARNESS_JOBS=${HARNESS_JOBS:-4}
142
143   non-caching:
144     runs-on: ubuntu-latest
145     steps:
146     - uses: actions/checkout@v3
147     - name: checkout fuzz/corpora submodule
148       run: git submodule update --init --depth 1 fuzz/corpora
149     - name: config
150       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
151     - name: make
152       run: make -s -j4
153     - name: make test
154       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]"
155
156   address_ub_sanitizer:
157     runs-on: ubuntu-latest
158     steps:
159     - uses: actions/checkout@v3
160     - name: checkout fuzz/corpora submodule
161       run: git submodule update --init --depth 1 fuzz/corpora
162     - name: config
163       run: ./config --banner=Configured --debug enable-asan enable-ubsan enable-rc5 enable-md2 enable-ec_nistp_64_gcc_128 enable-fips enable-quic -DFUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION && perl configdata.pm --dump
164     - name: make
165       run: make -s -j4
166     - name: make test
167       run: make test HARNESS_JOBS=${HARNESS_JOBS:-4} OPENSSL_TEST_RAND_ORDER=0
168
169   memory_sanitizer:
170     runs-on: ubuntu-latest
171     steps:
172     - uses: actions/checkout@v3
173     - name: checkout fuzz/corpora submodule
174       run: git submodule update --init --depth 1 fuzz/corpora
175     - name: config
176       # --debug -O1 is to produce a debug build that runs in a reasonable amount of time
177       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 enable-quic && perl configdata.pm --dump
178     - name: make
179       run: make -s -j4
180     - name: make test
181       run: make test HARNESS_JOBS=${HARNESS_JOBS:-4} OPENSSL_TEST_RAND_ORDER=0
182
183   threads_sanitizer:
184     runs-on: ubuntu-latest
185     steps:
186     - uses: actions/checkout@v3
187     - name: checkout fuzz/corpora submodule
188       run: git submodule update --init --depth 1 fuzz/corpora
189     - name: config
190       run: CC=clang ./config --banner=Configured no-fips --strict-warnings -fsanitize=thread enable-quic && perl configdata.pm --dump
191     - name: make
192       run: make -s -j4
193     - name: make test
194       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}
195
196   enable_non-default_options:
197     runs-on: ubuntu-latest
198     steps:
199     - uses: actions/checkout@v3
200     - name: checkout fuzz/corpora submodule
201       run: git submodule update --init --depth 1 fuzz/corpora
202     - name: modprobe tls
203       run: sudo modprobe tls
204     - name: config
205       run: ./config --banner=Configured --strict-warnings no-ec enable-ssl-trace enable-zlib enable-zlib-dynamic enable-crypto-mdebug enable-crypto-mdebug-backtrace enable-egd enable-ktls enable-fips enable-quic no-threads && perl configdata.pm --dump
206     - name: make
207       run: make -s -j4
208     - name: make test
209       run: make test HARNESS_JOBS=${HARNESS_JOBS:-4}
210
211   fips_and_ktls:
212     runs-on: ubuntu-latest
213     steps:
214     - uses: actions/checkout@v3
215     - name: checkout fuzz/corpora submodule
216       run: git submodule update --init --depth 1 fuzz/corpora
217     - name: modprobe tls
218       run: sudo modprobe tls
219     - name: config
220       run: ./config --banner=Configured --strict-warnings enable-ktls enable-fips enable-quic && perl configdata.pm --dump
221     - name: make
222       run: make -s -j4
223     - name: make test
224       run: make test HARNESS_JOBS=${HARNESS_JOBS:-4}
225
226   enable_brotli_dynamic:
227     runs-on: ubuntu-latest
228     steps:
229     - name: install brotli
230       run: |
231         sudo apt-get update
232         sudo apt-get -yq --no-install-suggests --no-install-recommends --force-yes install brotli libbrotli1 libbrotli-dev
233     - name: checkout openssl
234       uses: actions/checkout@v3
235     - name: checkout fuzz/corpora submodule
236       run: git submodule update --init --depth 1 fuzz/corpora
237     - name: config
238       run: ./config enable-comp enable-brotli enable-brotli-dynamic && perl configdata.pm --dump
239     - name: make
240       run: make -s -j4
241     - name: make test
242       run: make test HARNESS_JOBS=${HARNESS_JOBS:-4}
243
244   enable_zstd_dynamic:
245     runs-on: ubuntu-latest
246     steps:
247     - name: install zstd
248       run: |
249         sudo apt-get update
250         sudo apt-get -yq --no-install-suggests --no-install-recommends --force-yes install zstd libzstd1 libzstd-dev
251     - name: checkout openssl
252       uses: actions/checkout@v3
253     - name: checkout fuzz/corpora submodule
254       run: git submodule update --init --depth 1 fuzz/corpora
255     - name: config
256       run: ./config enable-comp enable-zstd enable-zstd-dynamic && perl configdata.pm --dump
257     - name: make
258       run: make -s -j4
259     - name: make test
260       run: make test HARNESS_JOBS=${HARNESS_JOBS:-4}
261
262   enable_brotli_and_zstd_dynamic:
263     runs-on: ubuntu-latest
264     steps:
265     - name: install brotli and zstd
266       run: |
267         sudo apt-get update
268         sudo apt-get -yq --no-install-suggests --no-install-recommends --force-yes install brotli libbrotli1 libbrotli-dev
269         sudo apt-get -yq --no-install-suggests --no-install-recommends --force-yes install zstd libzstd1 libzstd-dev
270     - name: checkout openssl
271       uses: actions/checkout@v3
272     - name: checkout fuzz/corpora submodule
273       run: git submodule update --init --depth 1 fuzz/corpora
274     - name: config
275       run: ./config enable-comp enable-brotli enable-brotli-dynamic enable-zstd enable-zstd-dynamic && perl configdata.pm --dump
276     - name: make
277       run: make -s -j4
278     - name: make test
279       run: make test HARNESS_JOBS=${HARNESS_JOBS:-4}
280
281   enable_brotli_and_asan_ubsan:
282     runs-on: ubuntu-latest
283     steps:
284     - name: install brotli
285       run: |
286         sudo apt-get update
287         sudo apt-get -yq --no-install-suggests --no-install-recommends --force-yes install brotli libbrotli1 libbrotli-dev
288     - name: checkout openssl
289       uses: actions/checkout@v3
290     - name: checkout fuzz/corpora submodule
291       run: git submodule update --init --depth 1 fuzz/corpora
292     - name: config
293       run: ./config --banner=Configured --debug enable-asan enable-ubsan enable-comp enable-brotli -DFUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION -DPEDANTIC && perl configdata.pm --dump
294     - name: make
295       run: make -s -j4
296     - name: make test
297       run: make test HARNESS_JOBS=${HARNESS_JOBS:-4} OPENSSL_TEST_RAND_ORDER=0
298
299   enable_zstd_and_asan_ubsan:
300     runs-on: ubuntu-latest
301     steps:
302     - name: install zstd
303       run: |
304         sudo apt-get update
305         sudo apt-get -yq --no-install-suggests --no-install-recommends --force-yes install zstd libzstd1 libzstd-dev
306     - name: checkout openssl
307       uses: actions/checkout@v3
308     - name: checkout fuzz/corpora submodule
309       run: git submodule update --init --depth 1 fuzz/corpora
310     - name: config
311       run: ./config --banner=Configured --debug enable-asan enable-ubsan enable-comp enable-zstd -DFUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION -DPEDANTIC && perl configdata.pm --dump
312     - name: make
313       run: make -s -j4
314     - name: make test
315       run: make test HARNESS_JOBS=${HARNESS_JOBS:-4} OPENSSL_TEST_RAND_ORDER=0
316
317   no-legacy:
318     runs-on: ubuntu-latest
319     steps:
320     - uses: actions/checkout@v3
321     - name: checkout fuzz/corpora submodule
322       run: git submodule update --init --depth 1 fuzz/corpora
323     - name: config
324       run: ./config --banner=Configured --strict-warnings no-legacy enable-fips enable-quic && perl configdata.pm --dump
325     - name: make
326       run: make -s -j4
327     - name: make test
328       run: make test HARNESS_JOBS=${HARNESS_JOBS:-4}
329
330   legacy:
331     runs-on: ubuntu-latest
332     steps:
333     - uses: actions/checkout@v3
334     - name: checkout fuzz/corpora submodule
335       run: git submodule update --init --depth 1 fuzz/corpora
336     - name: config
337       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
338     - name: make
339       run: make -s -j4
340     - name: make test
341       run: make test HARNESS_JOBS=${HARNESS_JOBS:-4}
342
343   enable-tfo:
344     strategy:
345       matrix:
346         os: [ ubuntu-latest, macos-latest ]
347     runs-on: ${{matrix.os}}
348     steps:
349     - uses: actions/checkout@v3
350     - name: checkout fuzz/corpora submodule
351       run: git submodule update --init --depth 1 fuzz/corpora
352     - name: config
353       run: CC=gcc ./config --banner=Configured enable-tfo enable-quic --strict-warnings && perl configdata.pm --dump
354     - name: make
355       run: make -s -j4
356     - name: make test
357       run: make test HARNESS_JOBS=${HARNESS_JOBS:-4}
358
359   buildtest:
360     runs-on: ubuntu-latest
361     steps:
362     - uses: actions/checkout@v3
363     - name: checkout fuzz/corpora submodule
364       run: git submodule update --init --depth 1 fuzz/corpora
365     - name: config
366       run: ./config --banner=Configured no-asm no-makedepend enable-buildtest-c++ enable-fips --strict-warnings -D_DEFAULT_SOURCE && perl configdata.pm --dump
367     - name: make
368       run: make -s -j4
369     - name: make test
370       run: make test HARNESS_JOBS=${HARNESS_JOBS:-4}
371
372   out-of-source-and-install:
373     strategy:
374       matrix:
375         os: [ubuntu-latest, macos-latest ]
376     runs-on: ${{matrix.os}}
377     steps:
378     - uses: actions/checkout@v3
379     - name: checkout fuzz/corpora submodule
380       run: git submodule update --init --depth 1 fuzz/corpora
381     - name: extra preparations
382       run: |
383         mkdir ./build
384         mkdir ./install
385     - name: config
386       run: ../config --banner=Configured enable-fips enable-acvp-tests --strict-warnings --prefix=$(cd ../install; pwd) && perl configdata.pm --dump
387       working-directory: ./build
388     - name: make
389       run: make -s -j4
390       working-directory: ./build
391     - name: make test
392       run: make test HARNESS_JOBS=${HARNESS_JOBS:-4}
393       working-directory: ./build
394     - name: make install
395       run: make install
396       working-directory: ./build
397
398   external-tests:
399     runs-on: ubuntu-latest
400     steps:
401     - uses: actions/checkout@v3
402       with:
403         submodules: recursive
404     - name: package installs
405       run: |
406         sudo apt-get update
407         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
408     - name: install cpanm and Test2::V0 for gost_engine testing
409       uses: perl-actions/install-with-cpanm@v1
410       with:
411         install: Test2::V0
412     - name: setup hostname workaround
413       run: sudo hostname localhost
414     - name: config
415       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
416     - name: make
417       run: make -s -j4
418     - name: test external gost-engine
419       run: make test TESTS="test_external_gost_engine"
420     - name: test external krb5
421       run: make test TESTS="test_external_krb5"
422     - name: test external_tlsfuzzer
423       run: make test TESTS="test_external_tlsfuzzer"
424     - name: test external oqs-provider
425       run: make test TESTS="test_external_oqsprovider"
426
427   external-test-pyca:
428     runs-on: ubuntu-latest
429     strategy:
430       matrix:
431         RUST:
432           - 1.51.0
433         PYTHON:
434           - 3.9
435     steps:
436     - uses: actions/checkout@v3
437       with:
438         submodules: recursive
439     - name: Configure OpenSSL
440       run: ./config --banner=Configured --strict-warnings --debug enable-external-tests && perl configdata.pm --dump
441     - name: make
442       run: make -s -j4
443     - name: Setup Python
444       uses: actions/setup-python@v4.6.0
445       with:
446         python-version: ${{ matrix.PYTHON }}
447     - uses: actions-rs/toolchain@v1
448       with:
449         profile: minimal
450         toolchain: ${{ matrix.RUST }}
451         override: true
452         default: true
453     - name: test external pyca
454       run: make test TESTS="test_external_pyca" VERBOSE=1
455
456   external-test-cf-quiche:
457     runs-on: ubuntu-latest
458     steps:
459     - uses: actions/checkout@v3
460       with:
461         submodules: recursive
462     - name: Configure OpenSSL
463       run: ./config --banner=Configured --strict-warnings enable-external-tests enable-quic && perl configdata.pm --dump
464     - name: make
465       run: make -s -j4
466     - uses: actions-rs/toolchain@v1
467       with:
468         profile: default
469         toolchain: stable
470         default: true
471     - name: test external Cloudflare quiche
472       run: make test TESTS="test_external_cf_quiche" VERBOSE=1