Use severity: ABI changed label instead of CI failure for ABIDIFF
[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   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: ubuntu-latest
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: ubuntu-latest
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:
164     strategy:
165       matrix:
166         os: [ ubuntu-latest, macos-latest ]
167     runs-on: ${{matrix.os}}
168     steps:
169     - uses: actions/checkout@v4
170     - name: checkout fuzz/corpora submodule
171       run: git submodule update --init --depth 1 fuzz/corpora
172     - name: config
173       run: ./config --banner=Configured --strict-warnings no-shared no-fips && perl configdata.pm --dump
174     - name: make
175       run: make -s -j4
176     - name: get cpu info
177       run: ./util/opensslwrap.sh version -c
178     - name: make test
179       run: make test HARNESS_JOBS=${HARNESS_JOBS:-4}
180
181   non-caching:
182     runs-on: ubuntu-latest
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 --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
189     - name: make
190       run: make -s -j4
191     - name: get cpu info
192       run: |
193         cat /proc/cpuinfo
194         ./util/opensslwrap.sh version -c
195     - name: make test
196       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]"
197
198   address_ub_sanitizer:
199     runs-on: ubuntu-latest
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 enable-rc5 enable-md2 enable-ec_nistp_64_gcc_128 enable-fips && 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
214
215   fuzz_tests:
216     runs-on: ubuntu-latest
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 -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
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 TESTS="test_fuzz*"
231
232   memory_sanitizer:
233     runs-on: ubuntu-latest
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       # --debug -O1 is to produce a debug build that runs in a reasonable amount of time
240       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
241     - name: make
242       run: make -s -j4
243     - name: get cpu info
244       run: |
245         cat /proc/cpuinfo
246         ./util/opensslwrap.sh version -c
247     - name: make test
248       run: make test HARNESS_JOBS=${HARNESS_JOBS:-4} OPENSSL_TEST_RAND_ORDER=0
249
250   threads_sanitizer:
251     runs-on: ubuntu-latest
252     steps:
253     - uses: actions/checkout@v4
254     - name: checkout fuzz/corpora submodule
255       run: git submodule update --init --depth 1 fuzz/corpora
256     - name: config
257       run: CC=clang ./config --banner=Configured no-fips --strict-warnings -fsanitize=thread && 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 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}
266
267   enable_non-default_options:
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: config
276       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
277     - name: make
278       run: make -s -j4
279     - name: get cpu info
280       run: |
281         cat /proc/cpuinfo
282         ./util/opensslwrap.sh version -c
283     - name: make test
284       run: make test HARNESS_JOBS=${HARNESS_JOBS:-4}
285
286   full_featured:
287     runs-on: ubuntu-latest
288     steps:
289     - uses: actions/checkout@v4
290     - name: checkout fuzz/corpora submodule
291       run: git submodule update --init --depth 1 fuzz/corpora
292     - name: modprobe tls
293       run: sudo modprobe tls
294     - name: Enable sctp
295       run: sudo modprobe sctp
296     - name: Enable auth in sctp
297       run: sudo sysctl -w net.sctp.auth_enable=1 
298     - name: install extra config support
299       run: sudo apt-get -y install libsctp-dev abigail-tools libzstd-dev zstd
300     - name: config
301       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
302     - name: make
303       run: make -s -j4
304     - name: get cpu info
305       run: |
306         cat /proc/cpuinfo
307         ./util/opensslwrap.sh version -c
308     - name: make test
309       run: make test HARNESS_JOBS=${HARNESS_JOBS:-4}
310
311   no-legacy:
312     runs-on: ubuntu-latest
313     steps:
314     - uses: actions/checkout@v4
315     - name: checkout fuzz/corpora submodule
316       run: git submodule update --init --depth 1 fuzz/corpora
317     - name: config
318       run: ./config --banner=Configured --strict-warnings no-legacy enable-fips && 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   legacy:
329     runs-on: ubuntu-latest
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 -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
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   out-of-source-and-install:
346     strategy:
347       matrix:
348         os: [ubuntu-latest, macos-latest ]
349     runs-on: ${{matrix.os}}
350     steps:
351     - uses: actions/checkout@v4
352     - name: checkout fuzz/corpora submodule
353       run: git submodule update --init --depth 1 fuzz/corpora
354     - name: extra preparations
355       run: |
356         mkdir ./build
357         mkdir ./install
358     - name: config
359       run: ../config --banner=Configured enable-fips enable-acvp-tests --strict-warnings --prefix=$(cd ../install; pwd) && perl configdata.pm --dump
360       working-directory: ./build
361     - name: make
362       run: make -s -j4
363       working-directory: ./build
364     - name: get cpu info
365       run: ./util/opensslwrap.sh version -c
366       working-directory: ./build
367     - name: make test
368       run: make test HARNESS_JOBS=${HARNESS_JOBS:-4}
369       working-directory: ./build
370     - name: make install
371       run: make install
372       working-directory: ./build
373
374   external-tests:
375     runs-on: ubuntu-latest
376     steps:
377     - uses: actions/checkout@v4
378       with:
379         submodules: recursive
380     - name: package installs
381       run: |
382         sudo apt-get update
383         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
384     - name: install cpanm and Test2::V0 for gost_engine testing
385       uses: perl-actions/install-with-cpanm@v1
386       with:
387         install: Test2::V0
388     - name: setup hostname workaround
389       run: sudo hostname localhost
390     - name: config
391       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
392     - name: make
393       run: make -s -j4
394     - name: get cpu info
395       run: |
396         cat /proc/cpuinfo
397         ./util/opensslwrap.sh version -c
398     - name: test external gost-engine
399       run: make test TESTS="test_external_gost_engine"
400     - name: test external krb5
401       run: make test TESTS="test_external_krb5"
402     - name: test external_tlsfuzzer
403       run: make test TESTS="test_external_tlsfuzzer"
404     - name: test external oqs-provider
405       run: make test TESTS="test_external_oqsprovider"
406
407   external-test-pyca:
408     runs-on: ubuntu-latest
409     strategy:
410       matrix:
411         RUST:
412           - 1.51.0
413         PYTHON:
414           - 3.9
415     steps:
416     - uses: actions/checkout@v4
417       with:
418         submodules: recursive
419     - name: Configure OpenSSL
420       run: ./config --banner=Configured --strict-warnings --debug enable-external-tests && perl configdata.pm --dump
421     - name: make
422       run: make -s -j4
423     - name: Setup Python
424       uses: actions/setup-python@v4.7.1
425       with:
426         python-version: ${{ matrix.PYTHON }}
427     - uses: actions-rs/toolchain@v1
428       with:
429         profile: minimal
430         toolchain: ${{ matrix.RUST }}
431         override: true
432         default: true
433     - name: get cpu info
434       run: |
435         cat /proc/cpuinfo
436         ./util/opensslwrap.sh version -c
437     - name: test external pyca
438       run: make test TESTS="test_external_pyca" VERBOSE=1
439
440   external-test-cf-quiche:
441     runs-on: ubuntu-latest
442     steps:
443     - uses: actions/checkout@v4
444       with:
445         submodules: recursive
446     - name: Configure OpenSSL
447       run: ./config --banner=Configured --strict-warnings enable-external-tests && perl configdata.pm --dump
448     - name: make
449       run: make -s -j4
450     - uses: actions-rs/toolchain@v1
451       with:
452         profile: default
453         toolchain: stable
454         default: true
455     - name: get cpu info
456       run: |
457         cat /proc/cpuinfo
458         ./util/opensslwrap.sh version -c
459     - name: test external Cloudflare quiche
460       run: make test TESTS="test_external_cf_quiche" VERBOSE=1