]> git.ipfire.org Git - thirdparty/openssl.git/blob - .github/workflows/ci.yml
When abidiff fails print out the XML diff
[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 full_feat_w_abidiff:
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: |
291 if ! abidiff ./.github/workflows/libcrypto-abi.xml ./libcrypto.so ; then
292 abidw --out-file libcrypto-abi-new.xml ./libcrypto.so
293 diff -u ./.github/workflows/libcrypto-abi.xml libcrypto-abi-new.xml
294 fi
295 - name: Check ABI compatibility for libssl
296 run: |
297 if ! abidiff ./.github/workflows/libssl-abi.xml ./libssl.so ; then
298 abidw --out-file libssl-abi-new.xml ./libssl.so
299 diff -u ./.github/workflows/libssl-abi.xml libssl-abi-new.xml
300 fi
301 - name: make test
302 run: make test HARNESS_JOBS=${HARNESS_JOBS:-4}
303
304 no-legacy:
305 runs-on: ubuntu-latest
306 steps:
307 - uses: actions/checkout@v4
308 - name: checkout fuzz/corpora submodule
309 run: git submodule update --init --depth 1 fuzz/corpora
310 - name: config
311 run: ./config --banner=Configured --strict-warnings no-legacy enable-fips && perl configdata.pm --dump
312 - name: make
313 run: make -s -j4
314 - name: get cpu info
315 run: |
316 cat /proc/cpuinfo
317 ./util/opensslwrap.sh version -c
318 - name: make test
319 run: make test HARNESS_JOBS=${HARNESS_JOBS:-4}
320
321 legacy:
322 runs-on: ubuntu-latest
323 steps:
324 - uses: actions/checkout@v4
325 - name: checkout fuzz/corpora submodule
326 run: git submodule update --init --depth 1 fuzz/corpora
327 - name: config
328 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
329 - name: make
330 run: make -s -j4
331 - name: get cpu info
332 run: |
333 cat /proc/cpuinfo
334 ./util/opensslwrap.sh version -c
335 - name: make test
336 run: make test HARNESS_JOBS=${HARNESS_JOBS:-4}
337
338 out-of-source-and-install:
339 strategy:
340 matrix:
341 os: [ubuntu-latest, macos-latest ]
342 runs-on: ${{matrix.os}}
343 steps:
344 - uses: actions/checkout@v4
345 - name: checkout fuzz/corpora submodule
346 run: git submodule update --init --depth 1 fuzz/corpora
347 - name: extra preparations
348 run: |
349 mkdir ./build
350 mkdir ./install
351 - name: config
352 run: ../config --banner=Configured enable-fips enable-acvp-tests --strict-warnings --prefix=$(cd ../install; pwd) && perl configdata.pm --dump
353 working-directory: ./build
354 - name: make
355 run: make -s -j4
356 working-directory: ./build
357 - name: get cpu info
358 run: ./util/opensslwrap.sh version -c
359 working-directory: ./build
360 - name: make test
361 run: make test HARNESS_JOBS=${HARNESS_JOBS:-4}
362 working-directory: ./build
363 - name: make install
364 run: make install
365 working-directory: ./build
366
367 external-tests:
368 runs-on: ubuntu-latest
369 steps:
370 - uses: actions/checkout@v4
371 with:
372 submodules: recursive
373 - name: package installs
374 run: |
375 sudo apt-get update
376 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
377 - name: install cpanm and Test2::V0 for gost_engine testing
378 uses: perl-actions/install-with-cpanm@v1
379 with:
380 install: Test2::V0
381 - name: setup hostname workaround
382 run: sudo hostname localhost
383 - name: config
384 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
385 - name: make
386 run: make -s -j4
387 - name: get cpu info
388 run: |
389 cat /proc/cpuinfo
390 ./util/opensslwrap.sh version -c
391 - name: test external gost-engine
392 run: make test TESTS="test_external_gost_engine"
393 - name: test external krb5
394 run: make test TESTS="test_external_krb5"
395 - name: test external_tlsfuzzer
396 run: make test TESTS="test_external_tlsfuzzer"
397 - name: test external oqs-provider
398 run: make test TESTS="test_external_oqsprovider"
399
400 external-test-pyca:
401 runs-on: ubuntu-latest
402 strategy:
403 matrix:
404 RUST:
405 - 1.51.0
406 PYTHON:
407 - 3.9
408 steps:
409 - uses: actions/checkout@v4
410 with:
411 submodules: recursive
412 - name: Configure OpenSSL
413 run: ./config --banner=Configured --strict-warnings --debug enable-external-tests && perl configdata.pm --dump
414 - name: make
415 run: make -s -j4
416 - name: Setup Python
417 uses: actions/setup-python@v4.7.1
418 with:
419 python-version: ${{ matrix.PYTHON }}
420 - uses: actions-rs/toolchain@v1
421 with:
422 profile: minimal
423 toolchain: ${{ matrix.RUST }}
424 override: true
425 default: true
426 - name: get cpu info
427 run: |
428 cat /proc/cpuinfo
429 ./util/opensslwrap.sh version -c
430 - name: test external pyca
431 run: make test TESTS="test_external_pyca" VERBOSE=1
432
433 external-test-cf-quiche:
434 runs-on: ubuntu-latest
435 steps:
436 - uses: actions/checkout@v4
437 with:
438 submodules: recursive
439 - name: Configure OpenSSL
440 run: ./config --banner=Configured --strict-warnings enable-external-tests && perl configdata.pm --dump
441 - name: make
442 run: make -s -j4
443 - uses: actions-rs/toolchain@v1
444 with:
445 profile: default
446 toolchain: stable
447 default: true
448 - name: get cpu info
449 run: |
450 cat /proc/cpuinfo
451 ./util/opensslwrap.sh version -c
452 - name: test external Cloudflare quiche
453 run: make test TESTS="test_external_cf_quiche" VERBOSE=1