1 # Copyright 2021-2023 The OpenSSL Project Authors. All Rights Reserved.
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
10 on: [pull_request, push]
12 # for some reason, this does not work:
15 # HARNESS_JOBS: "${HARNESS_JOBS:-4}"
17 # for some reason, this does not work:
29 runs-on: ${{ github.server_url == 'https://github.com' && 'ubuntu-latest' || 'ubuntu-22.04-self-hosted' }}
31 - name: install unifdef
34 sudo apt-get -yq --no-install-suggests --no-install-recommends --force-yes install unifdef
35 - uses: actions/checkout@v4
39 run: ./config --banner=Configured --strict-warnings enable-fips && perl configdata.pm --dump
40 - name: make build_generated
41 run: make -s build_generated
45 run: git diff --exit-code
48 runs-on: ${{ github.server_url == 'https://github.com' && 'ubuntu-latest' || 'ubuntu-22.04-self-hosted' }}
50 - uses: actions/checkout@v4
52 run: ./config --banner=Configured --strict-warnings enable-fips && perl configdata.pm --dump
53 - name: make build_generated
54 run: make -s build_generated
64 # This checks that we use ANSI C language syntax and semantics.
65 # We are not as strict with libraries, but rather adapt to what's
66 # expected to be available in a certain version of each platform.
68 runs-on: ${{ github.server_url == 'https://github.com' && 'ubuntu-latest' || 'ubuntu-22.04-self-hosted' }}
70 - uses: actions/checkout@v4
72 run: CPPFLAGS=-ansi ./config --banner=Configured no-asm no-makedepend enable-buildtest-c++ enable-fips --strict-warnings -D_DEFAULT_SOURCE && perl configdata.pm --dump
77 runs-on: ${{ github.server_url == 'https://github.com' && 'ubuntu-latest' || 'ubuntu-22.04-self-hosted' }}
79 - uses: actions/checkout@v4
80 - name: checkout fuzz/corpora submodule
81 run: git submodule update --init --depth 1 fuzz/corpora
83 run: sudo locale-gen tr_TR.UTF-8
85 # enable-quic is on by default, but we leave it here to check we're testing the explicit enable somewhere
86 run: CC=gcc ./config --banner=Configured enable-fips enable-quic --strict-warnings && perl configdata.pm --dump
92 ./util/opensslwrap.sh version -c
94 run: .github/workflows/make-test
95 - name: save artifacts
96 uses: actions/upload-artifact@v4
102 runs-on: ${{ github.server_url == 'https://github.com' && 'ubuntu-latest' || 'ubuntu-22.04-self-hosted' }}
104 - uses: actions/checkout@v4
105 - name: checkout fuzz/corpora submodule
106 run: git submodule update --init --depth 1 fuzz/corpora
108 run: CC=clang ./config --banner=Configured no-fips --strict-warnings && perl configdata.pm --dump
114 ./util/opensslwrap.sh version -c
116 run: .github/workflows/make-test
117 - name: save artifacts
118 uses: actions/upload-artifact@v4
120 name: "ci@basic-clang"
124 if: github.repository == 'openssl/openssl'
127 os: [freebsd-13.2, ubuntu-arm64-22.04]
128 runs-on: ${{ matrix.os }}-self-hosted
129 continue-on-error: true
131 - uses: actions/checkout@v4
133 run: ./config enable-fips enable-ec_nistp_64_gcc_128 enable-md2 enable-rc5 enable-ssl3 enable-ssl3-method enable-trace
135 run: ./configdata.pm --dump
139 run: ./util/opensslwrap.sh version -c
141 run: .github/workflows/make-test
142 - name: save artifacts
143 uses: actions/upload-artifact@v4
145 name: "ci@self-hosted-${{ matrix.os }}"
149 runs-on: ${{ github.server_url == 'https://github.com' && 'ubuntu-latest' || 'ubuntu-22.04-self-hosted' }}
151 - uses: actions/checkout@v4
152 - name: checkout fuzz/corpora submodule
153 run: git submodule update --init --depth 1 fuzz/corpora
155 run: ./config --banner=Configured --strict-warnings no-bulk no-pic no-asm -DOPENSSL_NO_SECURE_MEMORY -DOPENSSL_SMALL_FOOTPRINT && perl configdata.pm --dump
157 run: make -j4 # verbose, so no -s here
161 ./util/opensslwrap.sh version -c
163 run: .github/workflows/make-test
164 - name: save artifacts
165 uses: actions/upload-artifact@v4
169 if-no-files-found: ignore
172 runs-on: ${{ github.server_url == 'https://github.com' && 'ubuntu-latest' || 'ubuntu-22.04-self-hosted' }}
174 - uses: actions/checkout@v4
175 - name: checkout fuzz/corpora submodule
176 run: git submodule update --init --depth 1 fuzz/corpora
178 run: ./config --banner=Configured --strict-warnings no-deprecated enable-fips && perl configdata.pm --dump
184 ./util/opensslwrap.sh version -c
186 run: .github/workflows/make-test
187 - name: save artifacts
188 uses: actions/upload-artifact@v4
190 name: "ci@no-deprecated"
194 runs-on: ${{ github.server_url == 'https://github.com' && 'ubuntu-latest' || 'ubuntu-22.04-self-hosted' }}
196 - uses: actions/checkout@v4
197 - name: checkout fuzz/corpora submodule
198 run: git submodule update --init --depth 1 fuzz/corpora
200 run: ./config --banner=Configured --strict-warnings no-shared no-fips && perl configdata.pm --dump
206 ./util/opensslwrap.sh version -c
208 run: .github/workflows/make-test
209 - name: save artifacts
210 uses: actions/upload-artifact@v4
212 name: "ci@no-shared-ubuntu"
216 runs-on: macos-latest
217 if: github.server_url == 'https://github.com'
219 - uses: actions/checkout@v4
220 - name: checkout fuzz/corpora submodule
221 run: git submodule update --init --depth 1 fuzz/corpora
223 run: ./config --banner=Configured --strict-warnings no-shared no-fips && perl configdata.pm --dump
229 ./util/opensslwrap.sh version -c
231 run: .github/workflows/make-test
232 - name: save artifacts
233 uses: actions/upload-artifact@v4
235 name: "ci@no-shared-macos"
239 runs-on: ${{ github.server_url == 'https://github.com' && 'ubuntu-latest' || 'ubuntu-22.04-self-hosted' }}
241 - uses: actions/checkout@v4
242 - name: checkout fuzz/corpora submodule
243 run: git submodule update --init --depth 1 fuzz/corpora
244 - name: Adjust ASLR for sanitizer
246 sudo cat /proc/sys/vm/mmap_rnd_bits
247 sudo sysctl -w vm.mmap_rnd_bits=28
249 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
255 ./util/opensslwrap.sh version -c
257 run: .github/workflows/make-test 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]"
258 - name: save artifacts
259 uses: actions/upload-artifact@v4
261 name: "ci@non-caching"
264 address_ub_sanitizer:
265 runs-on: ${{ github.server_url == 'https://github.com' && 'ubuntu-latest' || 'ubuntu-22.04-self-hosted' }}
267 - uses: actions/checkout@v4
268 - name: checkout fuzz/corpora submodule
269 run: git submodule update --init --depth 1 fuzz/corpora
270 - name: Adjust ASLR for sanitizer
272 sudo cat /proc/sys/vm/mmap_rnd_bits
273 sudo sysctl -w vm.mmap_rnd_bits=28
275 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
281 ./util/opensslwrap.sh version -c
283 run: .github/workflows/make-test OPENSSL_TEST_RAND_ORDER=0
284 - name: save artifacts
285 uses: actions/upload-artifact@v4
287 name: "ci@address_ub_sanitizer"
291 runs-on: ${{ github.server_url == 'https://github.com' && 'ubuntu-latest' || 'ubuntu-22.04-self-hosted' }}
293 - uses: actions/checkout@v4
294 - name: checkout fuzz/corpora submodule
295 run: git submodule update --init --depth 1 fuzz/corpora
296 - name: Adjust ASLR for sanitizer
298 sudo cat /proc/sys/vm/mmap_rnd_bits
299 sudo sysctl -w vm.mmap_rnd_bits=28
301 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
307 ./util/opensslwrap.sh version -c
309 run: .github/workflows/make-test OPENSSL_TEST_RAND_ORDER=0 TESTS="test_fuzz*"
310 - name: save artifacts
311 uses: actions/upload-artifact@v4
313 name: "ci@fuzz_tests"
315 if-no-files-found: ignore
318 runs-on: ${{ github.server_url == 'https://github.com' && 'ubuntu-latest' || 'ubuntu-22.04-self-hosted' }}
320 - uses: actions/checkout@v4
321 - name: checkout fuzz/corpora submodule
322 run: git submodule update --init --depth 1 fuzz/corpora
323 - name: Adjust ASLR for sanitizer
325 sudo cat /proc/sys/vm/mmap_rnd_bits
326 sudo sysctl -w vm.mmap_rnd_bits=28
328 # --debug -O1 is to produce a debug build that runs in a reasonable amount of time
329 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
335 ./util/opensslwrap.sh version -c
337 run: .github/workflows/make-test OPENSSL_TEST_RAND_ORDER=0
338 - name: save artifacts
339 uses: actions/upload-artifact@v4
341 name: "ci@memory_sanitizer"
345 runs-on: ${{ github.server_url == 'https://github.com' && 'ubuntu-latest' || 'ubuntu-22.04-self-hosted' }}
347 - uses: actions/checkout@v4
348 - name: checkout fuzz/corpora submodule
349 run: git submodule update --init --depth 1 fuzz/corpora
350 - name: Adjust ASLR for sanitizer
352 sudo cat /proc/sys/vm/mmap_rnd_bits
353 sudo sysctl -w vm.mmap_rnd_bits=28
355 run: CC=clang ./config --banner=Configured no-fips --strict-warnings -fsanitize=thread && perl configdata.pm --dump
361 ./util/opensslwrap.sh version -c
363 run: .github/workflows/make-test 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*"
364 - name: save artifacts
365 uses: actions/upload-artifact@v4
367 name: "ci@threads_sanitizer"
370 enable_non-default_options:
371 runs-on: ${{ github.server_url == 'https://github.com' && 'ubuntu-latest' || 'ubuntu-22.04-self-hosted' }}
373 - uses: actions/checkout@v4
374 - name: checkout fuzz/corpora submodule
375 run: git submodule update --init --depth 1 fuzz/corpora
377 run: sudo modprobe tls
379 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
385 ./util/opensslwrap.sh version -c
387 run: .github/workflows/make-test
388 - name: save artifacts
389 uses: actions/upload-artifact@v4
391 name: "ci@enable_non-default_options"
395 runs-on: ${{ github.server_url == 'https://github.com' && 'ubuntu-latest' || 'ubuntu-22.04-self-hosted' }}
397 - uses: actions/checkout@v4
398 - name: checkout fuzz/corpora submodule
399 run: git submodule update --init --depth 1 fuzz/corpora
401 run: sudo modprobe tls
403 run: sudo modprobe sctp
404 - name: Enable auth in sctp
405 run: sudo sysctl -w net.sctp.auth_enable=1
406 - name: install extra config support
407 run: sudo apt-get -y install libsctp-dev abigail-tools libzstd-dev zstd
409 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
415 ./util/opensslwrap.sh version -c
417 run: .github/workflows/make-test
418 - name: save artifacts
419 uses: actions/upload-artifact@v4
421 name: "ci@full_featured"
425 runs-on: ${{ github.server_url == 'https://github.com' && 'ubuntu-latest' || 'ubuntu-22.04-self-hosted' }}
427 - uses: actions/checkout@v4
428 - name: checkout fuzz/corpora submodule
429 run: git submodule update --init --depth 1 fuzz/corpora
431 run: ./config --banner=Configured --strict-warnings no-legacy enable-fips && perl configdata.pm --dump
437 ./util/opensslwrap.sh version -c
439 run: .github/workflows/make-test
440 - name: save artifacts
441 uses: actions/upload-artifact@v4
447 runs-on: ${{ github.server_url == 'https://github.com' && 'ubuntu-latest' || 'ubuntu-22.04-self-hosted' }}
449 - uses: actions/checkout@v4
450 - name: checkout fuzz/corpora submodule
451 run: git submodule update --init --depth 1 fuzz/corpora
453 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
459 ./util/opensslwrap.sh version -c
461 run: .github/workflows/make-test
462 - name: save artifacts
463 uses: actions/upload-artifact@v4
468 # out-of-source-and-install checks multiple things at the same time:
469 # - That building, testing and installing works from an out-of-source
471 # - That building, testing and installing works with a read-only source
473 out-of-readonly-source-and-install-ubuntu:
474 runs-on: ${{ github.server_url == 'https://github.com' && 'ubuntu-latest' || 'ubuntu-22.04-self-hosted' }}
476 - uses: actions/checkout@v4
479 - name: checkout fuzz/corpora submodule
480 run: git submodule update --init --depth 1 fuzz/corpora
481 working-directory: ./source
482 - name: make source read-only
483 run: chmod -R a-w ./source
484 - name: create build and install directories
490 ../source/config --banner=Configured enable-fips enable-quic enable-acvp-tests --strict-warnings --prefix=$(cd ../install; pwd)
491 perl configdata.pm --dump
492 working-directory: ./build
495 working-directory: ./build
499 ./util/opensslwrap.sh version -c
500 working-directory: ./build
502 run: ../source/.github/workflows/make-test
503 working-directory: ./build
504 - name: save artifacts
505 uses: actions/upload-artifact@v4
507 name: "ci@out-of-readonly-source-and-install-ubuntu"
508 path: build/artifacts/
511 working-directory: ./build
513 out-of-readonly-source-and-install-macos:
514 runs-on: macos-latest
515 if: github.server_url == 'https://github.com'
517 - uses: actions/checkout@v4
520 - name: checkout fuzz/corpora submodule
521 run: git submodule update --init --depth 1 fuzz/corpora
522 working-directory: ./source
523 - name: make source read-only
524 run: chmod -R a-w ./source
525 - name: create build and install directories
531 ../source/config --banner=Configured enable-fips enable-quic enable-acvp-tests --strict-warnings --prefix=$(cd ../install; pwd)
532 perl configdata.pm --dump
533 working-directory: ./build
536 working-directory: ./build
540 ./util/opensslwrap.sh version -c
541 working-directory: ./build
543 run: ../source/.github/workflows/make-test
544 working-directory: ./build
545 - name: save artifacts
546 uses: actions/upload-artifact@v4
548 name: "ci@out-of-readonly-source-and-install-macos"
549 path: build/artifacts/
552 working-directory: ./build
555 runs-on: ${{ github.server_url == 'https://github.com' && 'ubuntu-latest' || 'ubuntu-22.04-self-hosted' }}
557 - uses: actions/checkout@v4
559 submodules: recursive
560 - name: package installs
563 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
564 - name: install cpanm and Test2::V0 for gost_engine testing
565 uses: perl-actions/install-with-cpanm@v1
568 - name: setup hostname workaround
569 run: sudo hostname localhost
571 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
577 ./util/opensslwrap.sh version -c
578 - name: test external gost-engine
579 run: make test TESTS="test_external_gost_engine"
580 - name: test external krb5
581 run: make test TESTS="test_external_krb5"
582 - name: test external_tlsfuzzer
583 run: make test TESTS="test_external_tlsfuzzer"
584 - name: test external oqs-provider
585 run: make test TESTS="test_external_oqsprovider"
588 runs-on: ${{ github.server_url == 'https://github.com' && 'ubuntu-latest' || 'ubuntu-22.04-self-hosted' }}
596 - uses: actions/checkout@v4
598 submodules: recursive
599 - name: Configure OpenSSL
600 run: ./config --banner=Configured --strict-warnings --debug enable-external-tests && perl configdata.pm --dump
604 uses: actions/setup-python@v5.0.0
606 python-version: ${{ matrix.PYTHON }}
607 - uses: dtolnay/rust-toolchain@master
609 toolchain: ${{ matrix.RUST }}
613 ./util/opensslwrap.sh version -c
614 - name: test external pyca
615 run: make test TESTS="test_external_pyca" VERBOSE=1
617 external-test-cf-quiche:
618 runs-on: ${{ github.server_url == 'https://github.com' && 'ubuntu-latest' || 'ubuntu-22.04-self-hosted' }}
620 - uses: actions/checkout@v4
622 submodules: recursive
623 - name: Configure OpenSSL
624 run: ./config --banner=Configured --strict-warnings enable-external-tests && perl configdata.pm --dump
627 - uses: dtolnay/rust-toolchain@stable
631 ./util/opensslwrap.sh version -c
632 - name: test external Cloudflare quiche
633 run: make test TESTS="test_external_cf_quiche" VERBOSE=1